solaris scripting let: not found

April 15, 2010 at 13:00:43
Specs: Windows XP
Hi

I am getting an error let: not found on solaris script

please find the server details below
Machine hardware: sun4v
OS version: 5.10

************************************************
#!/bin/ksh
today=`date "+%b-%d-%Y"`
logdir=$LAWDIR/hrdev/zpsrc
subdiff=$LAWDIR/hrdev/zpsrc/subdiff.$dte$tme
logfl=$logdir/svncompare.log.$dte$tme
errlogfl=$logdir/svncompare.log.$dte$tme
pgtype="PD"
##################################################
Acrhivefile()
{
x=1
created="n"
echo "$MDATADIR/hr/archive/TestSubdiff-$today-$x"
file="$MDATADIR/hr/archive/TestSubdiff-$today-$x"
while [ "$created" != y ]
do
if [ ! -f "$LAWDIR/hrdev/zpsrc/$pgm" ]
then
let "x = x + 1"
echo "$x"
exit
else
pgm="ZP$x$pgtype"
echo "$LAWDIR/hrdev/zpsrc/$pgm"
echo $pgm >> $subdiff
diff $LAWDIR/hrdev/zpsrc/$pgm /apps/home/chandrap/hr9/lawson/SystemCode/lawhr/zpsrc/$pgm >> $subdiff
fi
done
}
##################################################
echo "calling Archive"
Acrhivefile
echo "calling Comppdcode"
Comppdcode
echo "calling script end"
exit;
******************************************************


See More: solaris scripting let: not found

Report •

#1
April 16, 2010 at 07:05:25
I ran your korn shell script, and I had no trouble with the let statement. My guess is, that for some reason, that your script is not being recognized as a korn shell script, and the default shell is used. If the default shell.is the bourne that shell doesn't support the let syntax.

This can happen if the #!/bin/ksh is not on line 1, column 1. That means you can not have any comments above #!/bin/ksh.


Report •
Related Solutions


Ask Question