if test $# -eq 1
then
echo "Input parameter passed into DMI_weekly.ksh..." | tee -a $RUNLOG
typeset -u ORACLE_SID
export ORACLE_SID="$1"
else
echo "ERROR 060: Arguments passed to DMI_weekly.ksh do not equal 1..." | tee -a $RUNLOG
echo "***Verify that a valid ORACLE_SID is being passed when calling script..." >> $RUNLOG
echo "See $RUNLOG for more details..."
echo "\nExiting DMI_weekly.ksh with exit status=1...\n"| tee -a $RUNLOG
echo "Preload Error: Arguments passed to DMI_weekly.ksh do not equal 1" |mailx -s "DMI_weekly.ksh (ERROR 070)" "
$MAILID"
exit 1
fi
This means the number of parameters (values) given to the script.
This small example will help you to understand :
Create the scritpt test.sh containing the following lines
echo "1st parameter : $1"
echo "2nd parameter : $2"
echo "3rd parameter : $3"
echo "Number of parameters: $#"
If you execute ./test.sh A B C
The output will be :
1st parameter : A
2nd parameter : B
3rd parameter : C
Number of parameters: 3
If now you execute ./test.sh A B
The output will be :
1st parameter : A
2nd parameter : B
3rd parameter :
Number of parameters: 2
Coming back to your script :
if test $# -eq 1 checks that one parameter is given to the script during its execution. Please notice this doesn't check the content of this parameter.