Home » Infrastructure » Unix » unix shell script error (unix)
unix shell script error [message #327017] Fri, 13 June 2008 07:20 Go to next message
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 #327020 is a reply to message #327017] Fri, 13 June 2008 07:44 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Note that you are at Oracle FAQ forum, not UNIX shell scripting one. Please, keep discussion Oracle-related. For other problems, visit appropriate forums.
Re: unix shell script error [message #327022 is a reply to message #327020] Fri, 13 June 2008 07:50 Go to previous message
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
Previous Topic: Which JDK to choose for Solaris unix server. Is it 32-bit or 64-bit java?
Next Topic: Call oracle proc from unix
Goto Forum:
  


Current Time: Thu Mar 28 14:19:45 CDT 2024