hi,
i have a shell script which has the code like this
FATAL=0
SUCCESS=1
SOURCEFILAPATH=$1
FILENAME=$2
if test -w $SOURCEFILEPATH/$FILENAME
then
echo "$FILENAME HAS BEEN RECEIVED "
else
echo "$FILENAME IS NOT PRESENT IN THE PATH "
exit $FATAL
fi
The file text1.txt is present under the path /home/sourcefile
when i execute this shell script from Sequence Job using a ExecuteCommand stage like this "sh /home/script/checkfile.sh /home/sourcefile text1.txt" it is working fine and is giving the output "text1.txt HAS BEEN RECEIVED"
But when i call the shell script from my beforejob subroutine in this way
"Call DSExecute("UNIX","sh ":ScriptDIR:"/FCA_BAND_FILECOUNT_CHK.sh ":"/home/sourcefile text1.txt >":LogDIR:"/LogFile.txt",Output,SystemReturnCode)"
then in the lofile LogFile.txt iam getting the statement as "text1.txt IS NOT PRESENT IN THE PATH"
please help me in this.
Shell script through before job subroutine
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 80
- Joined: Fri Aug 21, 2009 7:49 am
- Location: India
When you say Before job subroutin, I beleive, you calling in the General tab of Job paramter. If thats the case, You can specify the follwing in the "ExecSH"
"sh /home/script/checkfile.sh /home/sourcefile text1.txt"
"sh /home/script/checkfile.sh /home/sourcefile text1.txt"
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
-
- Premium Member
- Posts: 138
- Joined: Wed Jul 16, 2008 9:51 pm
- Location: Kolkata
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Stick some echo commands into the script to determine what the received command line arguments are. These can be removed or crippled once your debugging session is done.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom