Solved

Converting batch files to shell scripts

Posted on 2006-06-27
7
838 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Assisted Solution

by:pjedmond
pjedmond earned 100 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 95 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IPA - running on unsupported CentOS servers? 1 101
FTP output from Wireshak 6 102
Issue to mail 11 111
route 2 traffic streams on single NIC 6 62
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 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