In sh, is '[' a portable synonym for 'test'?

John Ruschmeyer john at moncol.UUCP
Wed Oct 16 00:26:02 AEST 1985


>From: guy at sun.uucp (Guy Harris)
>Message-ID: <2887 at sun.uucp>
>Organization: Sun Microsystems, Inc.
>
>V7 systems where /bin/[ isn't a link to /bin/test.  Any V7 or post-V7 system
>can be made to support "if [ <condition> ]" as equivalent to "if test
><condition>", but the S5 manual properly warns you that not all systems have
>been made to support it.  If you want to make something portable, and you
>don't think you can convince every recipient of the program to make that
>link, you're best off not using "[ ... ]".

Any good reason *NOT* to make the link?


-- 
Name:		John Ruschmeyer
US Mail:	Monmouth College, W. Long Branch, NJ 07764
Phone:		(201) 222-6600 x366
UUCP:		...!vax135!petsd!moncol!john	...!princeton!moncol!john
						   ...!pesnta!moncol!john

	    "It all started out as a mild curiousity in a junkyard...
	    and now it's turned out to be quite a spirit of adventure."



More information about the Comp.unix.wizards mailing list