Article View: comp.unix.programmer
Article #1215Re: IF syntax
From: stetner Douglas Stetner
Date: Wed, 14 Nov 1990 22:18
Date: Wed, 14 Nov 1990 22:18
30 lines
1222 bytes
1222 bytes
In article <15796@brahms.udel.edu> jon@brahms.udel.edu (Jon Deutsch) writes:
>
>OK, second try at the question:
>
>I'm using sh to impliment an IF statement. Can't get it to work.
>Here's the code:
>
>
>#!/bin/sh
>if [$temp != ''] then
> echo 'remote-caller' >> .people;
>else
> echo 'inside-caller' >> .people;
>fi
>
Try (note quotes and spaces):
#!/bin/sh
if [ "$temp" != "" ]
then
echo 'remote-caller' >> .people;
else
echo 'inside-caller' >> .people;
fi
--
--------------------------------------------------------------------------------
Douglas G. Stetner, 4S75 | Bell-Northern Research | My opinions are my own.
stetner@bnr.ca | P.O. Box 3511, Stn. C | (613) 828-6321 (home)
..!uunet!bnrgate!stetner | Ottawa, ON, CANADA | (613) 763-8396 (work)
Technical Details
Message-ID:
<4887@bwdls58.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!bwdls61.bnr.ca!bwdls58!!stetnerReferences:
<15796@brahms.udel.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!bwdls61.bnr.ca!bwdls58!!stetner From: stetner@.bnr.ca (Douglas Stetner) Newsgroups: comp.unix.programmer Subject: Re: IF syntax Message-ID: <4887@bwdls58.UUCP> Date: 14 Nov 90 22:18:06 GMT References: <15796@brahms.udel.edu> Sender: news@bwdls58.UUCP Reply-To: stetner@bwdlh507.bnr.ca (Douglas Stetner) Organization: Bell-Northern Research, Ltd. Lines: 30