IF syntax

Earl Chew cechew at bruce.cs.monash.OZ.AU
Thu Nov 15 12:41:12 AEST 1990


In <965 at ksr.com> harsha at ksr.com (Paul Harsha) writes:

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

>works just fine.

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

works better when temp != '' :-)

Earl
-- 
Earl Chew, Dept of Computer Science, Monash University, Australia 3168
EMAIL: cechew at bruce.cs.monash.edu.au PHONE: 03 5655447 FAX: 03 5655146
----------------------------------------------------------------------



More information about the Comp.unix.programmer mailing list