Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Utilising variables in an IF statement

Status
Not open for further replies.

chris01010

Programmer
Jan 29, 2004
25
GB
Hi,

I'm having trouble with a script that i'm writing. Basically i'm trying to get my script to check a pre set variable in an IF statement and based on it's value follow a course of action.

i.e.

Variable $node is equal to "trial"

if

$node=trial

then

env=e

else

echo "This environment is only applicable to Trialling"

fi


At present it does seem to read the variable in to the statement. Any ideas??

Cheers

Chris
 
The syntax is not correct.
[tt]
if [ "$node" = "trial" ]
then
env=e
else
echo "This environment is only applicable to Trialling"
fi
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top