HowTo translate KSH Scripts to DOS Batch Files ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting HowTo translate KSH Scripts to DOS Batch Files ?
# 1  
Old 03-31-2010
Question HowTo translate KSH Scripts to DOS Batch Files ?

Hi there,

in near future I have to change my work surrounding from HP UNIX to Windows Vista (great to get rid of old hardware Smilie, but bad to loose UNIX Smilie ). As I heavily use KSH scripts to do my job, I was wondering, if there is any HowTo available, supporting me in re-writing the scripts to match DOS.

Could anyone help me out on this ? The main functionalties of KSH I am using are
- path/file opertations
- using the "function" ability
- basic mathematical functions

Does DOS deliver similar functionality (I fear not) ?

Remark:
I've claimed to get at least a Linux installation, but this was denied. I have to use Windows. The MKS toolkit is requested, but not yet clear, if it will be installed Smilie ,

Thanks for your support
Joe
# 2  
Old 03-31-2010
Some things can be done using the Windows command line. But as soon as you need tools like sed, grep, awk, sensible error code handling, ... you're pretty much out of luck.

Just present your boss with a simple calculation: the costs of you rewriting all your scripts to VBscript (or something else), including training, work hours, over time, ... versus the cost of an additional machine running Linux versus the MKS license.

And if they're still not convinced it's worth it (after all, they're moving from an server OS to an desktop OS): install Cygwin
# 3  
Old 03-31-2010
I'm going to second cygwin. I admin 100s of servers, a mix of solaris and RHEL, but use WinXP for my laptop. Cygwin is pretty much the first thing I install. Make sure you choose mintty from the list of shells (it's a really coo/simple terminal emulator).
# 4  
Old 03-31-2010
Hi,

thanks for the info. I am a noob with respect to the different softwares available. I am just used in UNIX programming which really helped me out a lot of times doing a simple thing often again. And yes, I use grep, awk etc. a lot of times...

I'll try to get more info about cygwin.

Thanks again for your help, this indeed gives me some more arguments to argue with my boss Smilie

Joe
# 5  
Old 03-31-2010
Cygwin + install cygwin sshd for remote win* host, then you can use remote host as you have done always.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting DOS Batch file to Shell Script

Hi, This is my DOS Batch file. @echo off echo "Program Name :" %0 rem echo "Next param :" %1 echo "Next param :" "Username/Password" echo "User Id :" %2 echo "User Name :" %3 echo "Request ID ... (4 Replies)
Discussion started by: Rami Reddy
4 Replies

2. Shell Programming and Scripting

Translate csh to ksh

Hi! I need to translate those line in csh (to initialise variable) into ksh construct. Any help would be appreciated! I don't know how to replace them :( Thanks Hulu setenv TestHul "$0 $*" setenv JG `setenvp "JG" "" "$*"` setenv A_1 `setenvp "A_1" "NA" "$*"` Please use next time... (2 Replies)
Discussion started by: patator67
2 Replies

3. Shell Programming and Scripting

Executing a batch of files within a shell script with option to refire the individual files in batch

Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below. I am on a solaris server btw. Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose. ... (2 Replies)
Discussion started by: goddevil
2 Replies

4. UNIX for Dummies Questions & Answers

Unix shell, Dos batch

Is the unix shell script equivalent to dos batch command? Thanks (2 Replies)
Discussion started by: zhshqzyc
2 Replies

5. Windows & DOS: Issues & Discussions

variable in dos batch file

Sir I have a very old cobol programme (source not availble). On execution and invoking some menu commands, depending upon the "pressed menu commands" it is writing certain values into a dos batch file. At the end of cobol file, this batch file gets exeuted. On keying in the Drive from which you... (6 Replies)
Discussion started by: chssastry
6 Replies

6. UNIX for Dummies Questions & Answers

DOS batch file to capture routers log

Hi, Please help to write DOS /Perl script to capture router AAA logs to store in file. RADIUS: id 1, priority 1, host 59.163.6.103, auth-port 1901, acct-port 1902 State: current UP, duration 1928071s, previous duration 0s Dead: total time 2798488914s, count 0 Authen:... (0 Replies)
Discussion started by: patilanna
0 Replies

7. Windows & DOS: Issues & Discussions

dos batch script

We need to write a dos batch script that does following in order numbered below: Connect to all UNIX boxes using IP,userid and password from a file. validate if login was successful check if there is at least 30mb disk space in the home folder of the user Check if there are any processes... (3 Replies)
Discussion started by: chandraachii
3 Replies

8. Windows & DOS: Issues & Discussions

dos batch script

Please dont post duplicate threads :confused: (0 Replies)
Discussion started by: lorcan
0 Replies

9. Windows & DOS: Issues & Discussions

Converting UNIX scripts to DOS

Is there a tool available to convert UNIX (BASH Shell) scripts to DOS scripts? I understand that DOS scripting is far inferior to unix scripting, and therfore this conversion may not be possible. Alternativley, perhaps I could convert my Unix scripts to C... then compile it for a windows... (2 Replies)
Discussion started by: Crozz
2 Replies

10. Shell Programming and Scripting

Converting Shell script to Dos batch files

Hi friends! I am having some simple shell script files to build postgresql database and all. Now i want to convert those scripts to dos batch scripts(to run on windows XP/2000/NT) because there is no need of unix emulation for latest release of postgresql. Please somebody help me. (1 Reply)
Discussion started by: darwinkna
1 Replies
Login or Register to Ask a Question