Hi,
I am calling a shell script through DSExecute also giving option with it e.g. test.sh -D 20060101 & this parameter I m using in test.sh
But when i run this null value goes into that parameter.
Is there any routine to execute the same ???
thanks,
Vinod
problem with DSExecute
Moderators: chulett, rschirm, roy
-
vinodpatel
- Participant
- Posts: 4
- Joined: Mon Aug 21, 2006 10:23 pm
- Location: Pune
-
vinodpatel
- Participant
- Posts: 4
- Joined: Mon Aug 21, 2006 10:23 pm
- Location: Pune
this my test.sh
getopts "D" option
STARTDATE=${OPTARG}
echo ${STARTDATE}
cd /prop/shr/tng/data/cim
ftp -v -n servername <<EOF
user username password
cd /prod/shr/tng/data/tinaarbor/rejects/tina
mget CDR_DATA_ARCHIVE_${STARTDATE}.dat
bye
EOF
to execute this i am calling routine
DSExecute("UNIX", "test.sh -D 20060101", Output, SystemReturnCode)
getopts "D" option
STARTDATE=${OPTARG}
echo ${STARTDATE}
cd /prop/shr/tng/data/cim
ftp -v -n servername <<EOF
user username password
cd /prod/shr/tng/data/tinaarbor/rejects/tina
mget CDR_DATA_ARCHIVE_${STARTDATE}.dat
bye
EOF
to execute this i am calling routine
DSExecute("UNIX", "test.sh -D 20060101", Output, SystemReturnCode)
I don't think your syntax for getopts is correct. You can verify this by echo'ing $0, $1, $2, $3 to see command line arguments passed. You'll see that your command line contains the date.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle