[18698] in Athena Bugs
Re: Bash init files suggestion
daemon@ATHENA.MIT.EDU (Kev)
Fri Jan 26 13:55:46 2001
Message-Id: <200101261855.NAA09252@multics.mit.edu>
To: Stephen Gildea <gildea@MIT.EDU>
cc: Greg Hudson <ghudson@MIT.EDU>, bugs@MIT.EDU
In-Reply-To: Your message of "Fri, 26 Jan 2001 13:49:55 EST."
<200101261849.NAA16711@mass-toolpike.mit.edu>
Date: Fri, 26 Jan 2001 13:55:41 -0500
From: Kev <klmitch@MIT.EDU>
> > > (Or, more readably, [ ! "$TERM" ].)
> >
> > This form of test won't work for all values of $TERM (such as "-e").
>
> Doesn't work in traditional sh, but POSIX specifies that it has to
> work, and it does work in Bash.
Imagine TERM=-e, as suggested; then that expands to [ ! -e ]. The way
this is often tested is [ "x$TERM" != x ]--the "x" prevents things starting
with "-" from being interpreted as arguments to test.
--
Kevin L. Mitchell <klmitch@mit.edu>