Solved

Converting batch files to shell scripts

Posted on 2006-06-27
7
833 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
Comment Utility
> 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
Comment Utility
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
Comment Utility
> 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 22

Assisted Solution

by:pjedmond
pjedmond earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
good suggestion, forgot about ancient dosemu
0
 

Author Comment

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

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

11 Experts available now in Live!

Get 1:1 Help Now