Why parse lines with colons

Nick Landsberg npl at spuxll.UUCP
Tue Jul 17 14:08:25 AEST 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}

This effectively sets $FOO to a default value if not previously
set.  The longhand way would be:

if [ "${FOO}" = "" ]
then
	FOO=default
fi


		From the hairy eyeball of ---
		Nick Landsberg ( ....!spuxll!npl)



More information about the Comp.unix.wizards mailing list