danhodges99
IS-IT--Management
I have a problem I don't understand... I am trying to declare a variable, and then output the results of that variable, couldn't be simpler
#!/bin/ksh
VAR='Oranges'
if [ ${VAR}='Lemons' ]
then
echo "Found Lemons"
elif [ ${VAR}='Oranges' ]
then
echo "Found Oranges"
fi
The output shouold clearly be "Found Oranges", but it outputs "Found Lemons", or whatever is first in the if statement, it's doing my head in, please somebody help!
#!/bin/ksh
VAR='Oranges'
if [ ${VAR}='Lemons' ]
then
echo "Found Lemons"
elif [ ${VAR}='Oranges' ]
then
echo "Found Oranges"
fi
The output shouold clearly be "Found Oranges", but it outputs "Found Lemons", or whatever is first in the if statement, it's doing my head in, please somebody help!