Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Converting batch files to shell scripts

Posted on 2006-06-27
7
Medium Priority
?
850 Views
Last Modified: 2008-01-09
Hi,

Is there any way of converting DOS batch files to shell scripts without writing them from scratch?  Is there any conversion tool out there?  Is there any emaulator that will run Batch files on Linux.  I had a quick look at wine but it did not seem that it would work.

Thanks
Gareth
0
Comment
Question by:garethcummings
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 16996311
> Is there any conversion tool out there?
I guess no.

> Is there any emaulator that will run Batch files on Linux.  
yes, for example wine

> Is there any way of converting DOS batch files to shell scripts without writing them from scratch?
hmm, writing from scratch would probably the fastest and safest way, will be more readable too ;-)
0
 

Author Comment

by:garethcummings
ID: 16999786
Thanks for you anwsers, I had a look at Wine already but I don't think it will enable us to run the batch files without causing errors.  Anybody else ever come accross this before?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 16999829
> Anybody else ever come accross this before?
I guess no, 'cause nobody realy writes script when there is a sophisticated GUI where you can plague and p(r)ay ;-)
hence there're no script which need to be converted (other than a simple shell oneliner, probably ...)
*SCNR*
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 22

Assisted Solution

by:pjedmond
pjedmond earned 400 total points
ID: 17004676
YOu may wish to have a look through these links:

http://www.tldp.org/LDP/abs/html/dosbatch.html

There is a DOS emulator for for linux which may help:

http://www.dosemu.org/

(   (()
(`-' _\
 ''  ''
0
 
LVL 27

Accepted Solution

by:
Nopius earned 380 total points
ID: 17006497
garethcummings, as pjedmond said, DOSEMU is the best solution for you.

You only need to map unix path to local drive in dosemu session, then to run batch files:

for example to map /tmp path to E: drive in 'dosemu' session, execute:

unix# dosemu
...
C:\>lredir E: LINUX\FS\tmp\


then run your batch file. Please note, there is a 8+3 naming conversion in DOS, so all unix filenames will look like lowercase 8+3 files.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17007060
good suggestion, forgot about ancient dosemu
0
 

Author Comment

by:garethcummings
ID: 17009209
Thanks guys thats exactly what I was looking for, I spilt the points between pjedmond and Nopius.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question