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
echo "File Name :" %5
echo "Entity Name :" %6
echo "Email Address :" %7
echo "Extract ID :" %8
echo "path name :" %9
cd %9
echo "Process Output files"
IF NOT EXIST C:\OraOutput GOTO MAPERROR
IF EXIST o%8.out (COPY o%8.out %5.csv) ELSE echo "Output file does not exists"
IF EXIST %5.csv (MOVE %5.csv C:\OraOutput\%5.cvs) ELSE echo "Could not move file to Share Drive"
GOTO ENDPROCESS
:MAPERROR
echo "The Share Directory has not been mapped Contact your System Administrator"
EXIT -1
:ENDPROCESS
echo "Process finished goodbye"
for this DOS Batch file, I have written equivalent shell script file.
#!/bin/bash
DATAFILE=/OraOutput
@echo off
echo "Program Name :" $0
#echo "Next param :" $1
echo "Next param :" "Username/Password"
echo "User Id :" $2
echo "User Name :" $3
echo "Request ID :" $4
echo "File Name :" $5
echo "Entity Name :" $6
echo "Email Address :" $7
echo "Extract ID :" $8
echo "path name :" $9
cd $9
echo "Process Output files"
if [ ! -e DATAFILE]; then
echo "The Share Directory has not been mapped Contact your System Administrator"
else
if [ -e o$8.out ]; then
(cp o$8.out $5.csv)
else
echo "Output file does not exists"
fi
if [-e $5.csv ]; then
mv $5.csv $DATAFILE/$5.cvs)
else
echo "Could not move file to Share Drive"
fi
echo "Process finished goodbye"
fi
exit -1
Please provide suggestion on how i can write script for the same.
Thanks,