Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!drutx!houxe!hogpc!houti!ariel!vax135!cornell!uw-beaver!tektronix!hplabs!hpda!fortune!amd!decwrl!decvax!cca!ima!haddock!dan From: dan@haddock.UUCP Newsgroups: net.unix-wizards Subject: Re: Why parse lines with colons - (nf) Message-ID: <216@haddock.UUCP> Date: Tue, 17-Jul-84 23:45:04 EDT Article-I.D.: haddock.216 Posted: Tue Jul 17 23:45:04 1984 Date-Received: Sun, 22-Jul-84 03:01:23 EDT Lines: 25 #R:spuxll:-52600:haddock:16800020:000:593 haddock!dan Jul 16 13:59:00 1984 > One of the reasons /bin/sh (bsh to those who like csh) > parses lines with ":" in the beginning is because of > constructs like the following: > : ${FOO:-default} I think you mean : ${FOO:=default} > This effectively sets $FOO to a default value if not previously > set. The longhand way would be: > if [ "${FOO}" = "" ] > then > FOO=default > fi No, the "longhand" way would be FOO=${FOO:-default} which isn't very much longer, and has the advantage that it works even if you set -u (which I usually do). I don't think this is a good reason to parse lines with ":". Dan Franklin