Quote:
Originally Posted by xplod4202
Here is the script that i am trying to run. I get an error and i can't figure out what is the problem.
#!/bin/bash
echo "What is your name"
read NAME
if [ $NAME -eq $Eugene ]; then
echo "My name is the same"
esle
echo "You have a nice name"
fi
|
Buddy,
The code is correct except that you have not declared the "Eugene" variable.
Hence its not able to compare the to variables so it might be throwing the error.
please use the below code:
#!/bin/bash
echo "What is your name"
read NAME
Eugene=Vicky
if [ $NAME -eq $Eugene ]; then
echo "My name is the same"
else
echo "You have a nice name"
fi
probably this would work. Please post the error if any....