|
IF THEN ELIF question in BOURNE SHELL
Hi,
I get an error when executing this sample script.
#!bin/sh
if [ $1 = ];
then
echo "you need to enter the release as the first parameter"
elif [ $1 = "ALL" ];
then
echo "HI how are you ABC"
echo "Hi how are you XYZ"
echo " hi how are you all"
else
echo "using the $1 as input parameter"
fi
i get the following error.
[: arun.sh 5: FSUM6807 expression syntax error
the script requires a parameter to be passed.. If no parameter is passed the script works fine and it displays the right message. and if the parameter is ALL then also it works fine...i get the above error only if the parameter is other than null or ALL.. how to resolve this...looks like there is a problem with the else statement.
|