/bin/true

BALDWIN mike at whuxl.UUCP
Sat May 3 05:52:02 AEST 1986


> In article <765 at bentley.UUCP> kwh at bentley.UUCP (KW Heuer) writes:
> >Btw, I never use "true".  ":" is equivalent, and is more likely to be
> >a builtin.  I've never had a use for "false".
> 
> Their main use is to hang system-type links on.
> For example, on the system I'm typing this on,
> "gould" is linked to "true" and other system
> types such as "vax" are linked to "false".
> These commands are very useful if you maintain
> code for multiple systems all in the same place.
> [D.Gwyn]

The "proper" way to do this is by testing `uname -m`.
Linking machine types to /bin/true clutters the name
space and makes pattern matching difficult.  For instance,
how would you do the following "cleanly" using the
link /bin/true method:

case `uname -m` in
3B*)	# 3b specific
vax*)	# vax specific
esac

True, "if gould" is prettier than "if [ `uname -m` = gould ]"
but that's a poor reason.  There need to be some standards on
what `uname -m` contains, though.
-- 
						Michael Baldwin
			(not the opinions of)	AT&T Bell Laboratories
						{at&t}!whuxl!mike



More information about the Comp.unix mailing list