I'm new to Shell scripting. In my shell script for Bourne shell, the script accepts a date parameter which is optional. If the value is supplied, the supplied value should be assigned to a variable. If not, the current date will be assigned to the variable. My script is like this.
#! /bin/sh
if [ ! -z $1 ]
then
dateval=`date`
elif [ $dateval -gt date ];then
echo "Supplied date is greater than current date"
else
dateval=$1
fi
echo $dateval
[[ ]] construct is available in bash. Standard shell lacks the construct, and I think the problem may be that sumesh is assuming that /bin/sh is a symlink to bash (which is the case on some systems).