IF syntax

Paul Harsha harsha at ksr.com
Thu Nov 15 05:39:40 AEST 1990


jon at brahms.udel.edu (Jon Deutsch) writes:



>#!/bin/sh
>if [$temp != '']  then
>        echo 'remote-caller' >> .people;
>else
>	echo 'inside-caller' >> .people;
>fi

>I keep getting an ELSE UNEXPECTED.  

You need to put the "then" on a seperate line

#!/bin/sh
if [$temp != '']  
then
        echo 'remote-caller' >> .people;
else
        echo 'inside-caller' >> .people;
fi

works just fine.

-Paul



More information about the Comp.unix.programmer mailing list