windows script to Unix


 
Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions windows script to Unix
# 1  
Old 03-17-2008
windows script to Unix

Dear All,

I am looking to understand the feasabilities to migrate the following batches command line into Unix plateform. If yes anyone can do it ?

UDB_import_AAA.bat

del /Q %VMAPdir%\Excel_files\*.*
del /Q %VMAPdir%\Log\*.*
del /Q %VMAPdir%\Output\*.*
del /Q %VMAPdir%\Reports\Input\*.*
del /Q %VMAPdir%\Reports\OutputCSV\*.*
rmdir /Q /S %VMAPdir%\Reports\Output
mkdir %VMAPdir%\Reports\Output

IF "%2"=="BE" GOTO BE_FOLDERS

:BE_FOLDERS
mkdir %VMAPdir%\Reports\Output\Risk
copy %VMAPdir%\Params\Readme.txt %VMAPdir%\Reports\Output\Risk
mkdir %VMAPdir%\Reports\Output\Other
copy %VMAPdir%\Params\Readme.txt %VMAPdir%\Reports\Output\Other
GOTO Launch_IMPORT


:Launch_IMPORT
@call "%sasdir%\sas.exe" -noautoexec -nosplash -dmsbatch -icon -sysin %VMAPdir%\SASCODE\Batch\UDB_import_AAA.sas -sysparm "%1 %2"

@if %errorlevel%==0 echo RC=%errorlevel%




UDB_CREATOR.bat


@call "%sasdir%\sas.exe" -noautoexec -nosplash -dmsbatch -icon -sysin %VMAPdir%\SASCODE\Batch\UDB_CREATOR.sas -sysparm "%1 %2"

rem TO DELETE IN NEXT RELEASE !!!!!!!!
copy %VMAPdir%\Output\init\paramMarketData_multi.xml %VMAPdir%\Output\paramMarketData_multi.xml


@if %errorlevel%==0 echo RC=%errorlevel%

XML_EXTRACT.bat


@call "%sasdir%\sas.exe" -noautoexec -nosplash -dmsbatch -icon -sysin %VMAPdir%\SASCODE\Batch\XML_EXTRACT.sas -sysparm "%1 %2"

@call "%sasdir%\sas.exe" -noautoexec -nosplash -dmsbatch -icon -sysin %VMAPdir%\SASCODE\Batch\RPA_Report.sas -sysparm "%1 %2"

@if %errorlevel%==0 echo RC=%errorlevel%


ETL_import_FTB.bat

@call "%sasdir%\sas.exe" -noautoexec -nosplash -dmsbatch -icon -sysin %VMAPdir%\SASCODE\Batch\ETL_import_FTB.sas

@if %errorlevel%==0 echo RC=%errorlevel%
# 2  
Old 03-17-2008
With the exception of the sas.exe lines, all the lines convert easily.
Do the following:
replace all \ with /
replace all %xxx% with $xxx
replace "del /q" with "rm"
make sure none of your file names have embedded spaces, or special characters.
mkdir is mkdir
rmdir is rmdir
replace the "if goto" construct with "if ....endif".

An alternative is to use a product like Samba on the unix system, export a share, and use your regular Windows script to manipulate the files.
# 3  
Old 03-18-2008
even the sas bit can easily be converted to something that works under unix but for that you need to know which version and on what unix...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

2. Shell Programming and Scripting

FTP from windows to unix server using unix shell script

Hi, Is it possible to ftp a huge zip file from windows to unix server using unix shell scripting? If so what command i need to use. thanks in advance. (1 Reply)
Discussion started by: Shri123
1 Replies

3. Shell Programming and Scripting

UNIX script to FTP file from UNIX server to windows

Hi, I am new to this subject.....Can someone please help me out with the script... unix usernm "sdhftst" unix pwd "chsd13" windows usernm "dfghtst" windows pwd "chsd13" path..../xxx/xxxxx/xxxxxx/xxxxxxx please can u get me a script...its only one file to get ftp. Thanks... (2 Replies)
Discussion started by: himakiran9
2 Replies

4. Shell Programming and Scripting

Unix shell script to Copy files from one Windows server to another Windows server.

Can anybody please help me on how to code for the below requirement: I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell... (4 Replies)
Discussion started by: SravsJaya
4 Replies

5. Solaris

Running unix script from windows.

Hi All, I need to call a unix script from windows bat file, please help if that can be done. I cant install cygwin or putty or any other ssh on server.....! do we have anything else? (8 Replies)
Discussion started by: fidelis
8 Replies

6. Shell Programming and Scripting

Change the Windows Batch script to UNIX shell script.

Hi, When I run the below script in UNIX it's throwing syntax errors. Actually it's a windows batch script. Could anyone change the below Windows Batch script to UNIX shell script... Script: REM :: File Name : Refresh_OTL.bat REM :: Parameters : %1 - Region REM :: : %2 - Cube Type REM ::... (5 Replies)
Discussion started by: tomailraj
5 Replies

7. UNIX for Advanced & Expert Users

Executing a shell script from windows;script present in unix

I need to execute a shell script kept in unix machine from windows. User id, password area available. For eg. There's a shell script wich moves all the logs kept in my home directory to a directory named LOGS. Now i need to get this done through windows; either using a batch file, or java... (4 Replies)
Discussion started by: rajneesh_kapoor
4 Replies

8. Shell Programming and Scripting

ftp from windows to unix using a perl script on unix machine

i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
Discussion started by: raksha.s
3 Replies

9. Shell Programming and Scripting

how to convert unix .ksh script to windows .batch script

I am using awk in my .ksh script but when I am trying to run in windows its not recognising awk part of the ksh script , even when I changed it to gawk it does not work, this is how my .ksh and .bat files look like. thanx. #!/bin/ksh egrep -v "Rpt 038|PM$|Parameters:|Begin |Date: |End... (1 Reply)
Discussion started by: 2.5lt V8
1 Replies

10. Shell Programming and Scripting

get the output of unix script in windows

Hai Actually I work on CVS, where the server is in UNIX and the front end(client) is windows. Now I want to run a script in unix and get the output(report) in windows. Can anyone help me in this as to how i can connect to dos..... Thanks (1 Reply)
Discussion started by: csrope
1 Replies
Login or Register to Ask a Question