[TUHS] test / [

Jose R. Valverde jrvalverde at cnb.uam.es
Thu Dec 6 02:00:09 AEST 2007


What I seem to remember is that it was a trick used in BSD to achieve 
compatibility with SystemV shell scripts (the shell on System-V would
understand [ .. ] but the one on BSD wouldn't and making [ a symlink
to test would fix the problem).

My copy of Portable C and UNIX system programming only mentions that
the [ .. ] construct may be missing on some shell versions and this
can usually be fixed by symlinking [ to test.

A hardlink from /bin/[ to /bin/test was present on Ultrix since at 
least 3.1, which would also attest to the BSDism or workaround for
non-System-V systems. Sorry, this is too far back in time for my 
feeble memory.

				j

On Wed, 5 Dec 2007 11:20:38 +1100
"Christopher Vance" <cjsvance at gmail.com> wrote:
> On Dec 5, 2007 10:25 AM, Greg 'groggy' Lehey <grog at lemis.com> wrote:
> > FreeBSD and NetBSD still have this link:
> >
> > $ ls -li /bin/[ /bin/test
> > 683091 -r-xr-xr-x  2 root  wheel  7460 Aug 19  2006 /bin/[
> > 683091 -r-xr-xr-x  2 root  wheel  7460 Aug 19  2006 /bin/test
> >
> > I suppose OpenBSD does too, but I don't have a machine to check.
> 
> Still there as of the latest release.
> 
> -- 
> Christopher Vance
> _______________________________________________
> TUHS mailing list
> TUHS at minnie.tuhs.org
> https://minnie.tuhs.org/mailman/listinfo/tuhs


-- 
	These opinions are mine and only mine. Hey man, I saw them first!

			    José R. Valverde

	De nada sirve la Inteligencia Artificial cuando falta la Natural
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20071205/a685ed4b/attachment.sig>


More information about the TUHS mailing list