Microsoft
Software
Hardware
Network
Question : Will a semicolon cause a shell script to skip lines or fail in any way?
Will a semicolon in a ksh script cause the script to fail or skip the next command? We built some scripts with a runfailedmsg function - one of the coders input the usage of the function as such:
--------------------- EXCERPT FROM SCRIPT--------------------
----------
----------
----------
----------
----------
------
if [ -s $ERRFILE ] ; then
echo "\n\n\nERROR: BatDimBuild.sh script failed on one or more processes." >> $LOGFILE 2>&1
echo " See Errors below:" >> $LOGFILE 2>&1
cat $ERRFILE >> $LOGFILE 2>&1
cat $PROCESSPATH/datafiles/Fai
ledDimBuil
dMsg.txt > $FailedMsgBody
echo "\nErrors occurred during one or more processes in BatDimBuild.sh script." >> $FailedMsgBody
echo "See script logfile or error files listed below for more details:" >> $FailedMsgBody
echo >> $FailedMsgBody
ls -l $ERRFILE >> $FailedMsgBody
runfailedmsg;
exit 1
fi
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
-----
And this appears to work - except it does not do the exit 1 - we are having a bit of discussion as to why the exit 1 was not passed to tivoli and one of the hackers looking at it said it was because the coder used a semicolon - these are used all over the place in our scripts and we have not noted failures - so can an expert tell me -- Will a semicolon cause it to skip lines or fail in any way?
Answer : Will a semicolon cause a shell script to skip lines or fail in any way?
is runfailedmsg a shell script??? maybe it uses own exit ...
if so, better use full path and dot in beginning to reuse current shell
. /full/script/path
Random Solutions
Right click on folder,can not open Properties and Sharing.
Run-time error 2501 The OpenReport action was canceled
how we can send message from server to CLIENT Comptuers ?
sed to delete lines with multiple matching patterns
ODBC - User DSN, System DSN, File DSN???
horizontal scroll bar missing
Populating one sharepoint list with info from another list
Windows Server 2003 display settings
Problem with Asp.Net AJAX AutocompleteExtender
symantec, norton ghost 10, cloned drive will not boot, cloned drive would boot to start up screen xp but no sign in icons