HELP! (What's wrong with this sh scr - (nf)
Dave Ihnat, Chicago, IL
ignatz at ihuxx.UUCP
Fri Apr 27 10:54:29 AEST 1984
Esp. RE: X$var vs. "$var":
This solution probably came from the example used in the USG (now WE)
Unix(Tm, of course) manual for the expr(1) command. On the very last
page of the man entry, they address the problem of null strings and
the shell getting to them as follows:
if
a='='
expr $a = '='
then looks like
expr = = =
and fails! (note that expr "$a" = '=' also fails)
Thus, they suggest
expr X$a = X=
to get around the problem.
Dave Ihnat
ihuxx!ignatz
More information about the Comp.unix
mailing list