BSD sh vs. System V sh
Keith Bloom
akbloom at aplcen.apl.jhu.edu
Tue Apr 11 12:33:57 AEST 1989
I use a SysV clone (Venix) and BSD 4.2. My login shell on both
systems is Bourne shell. Recently I took a shell script which
worked fine under Venix and moved it to BSD. When I ran the script,
I got the message "if: Expression syntax"
Based on a hunch (recollections of other scripts) I
inserted a ":" at the top of the script (before the "if").
It worked. I also tried inserting "#! /bin/sh", which also worked.
So the problem is solved, but I'd still like to understand why
this was necessary. Everything I've read about the : says simply
that it returns true - and so it does. But apparently that's not
all it does. Also, are there any differences between using : and
using #! /bin/sh ?
(Before you tell me to RTFM: the BSD documentation I inherited is
very disorganized, and parts of it are not there at all)
--
Keith Bloom UUCP: {rutgers|ames|uunet}!mimsy!apclen!akbloom
Internet: akbloom at aplcen.apl.jhu.edu
More information about the Comp.unix.questions
mailing list