Solved

Converting batch files to shell scripts

Posted on 2006-06-27
7
834 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
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now