unix shell script error [message #327017] |
Fri, 13 June 2008 07:20 |
souvik_roy
Messages: 16 Registered: June 2008
|
Junior Member |
|
|
I've written one shell script which will accept two numbers from user and compares them and display message according to the comparison.
echo "Opening the shell script1 file.."
echo "Enter the first number"
read a
echo "Enter the second number"
read b
if $a -gt $b;
then echo "First number is greater"
else
echo "The second number is greater"
fi
When running the script it is showing error as:
script2.ksh[6]: 34: not found
The second number is greater
Could you please help me regarding this?
|
|
|
|
Re: unix shell script error [message #327022 is a reply to message #327020] |
Fri, 13 June 2008 07:50 |
tahpush
Messages: 961 Registered: August 2006 Location: Stockholm/Sweden
|
Senior Member |
|
|
Try this
echo "Opening the shell script1 file.."
echo "Enter the first number"
read a
echo "Enter the second number"
read b
if [ "$a" -gt "$b" ];
then echo "First number is greater"
else
echo "The second number is greater"
fi
|
|
|