Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!uunet!mtndew!friedl From: friedl@mtndew.Tustin.CA.US (Steve Friedl) Newsgroups: comp.unix.questions Subject: Re: If $1 = "" I get an error, Help:-) Message-ID: <541@mtndew.Tustin.CA.US> Date: 8 Oct 90 06:09:15 GMT References: <311@alix.UUCP> <2919@canisius.UUCP> <5434@ptsfa.PacBell.COM> Distribution: usa Organization: VSI*FAX Tech Ctr, Tustin, CA Lines: 20 > Enclose the $1 in "s: > > if [ "$1" = "" ] > While this handles the null input case properly, it can get confused if the variable contains one of the magic tokens for test (say, "-x" or "!"). Better is to de-magify [?] the variable with: if [ x"$1" = x"" ] so you don't get the potential surprise. Steve -- Stephen J. Friedl, KA8CMY / I speak for me only / Tustin, CA / 3B2-kind-of-guy +1 714 544 6561 / friedl@mtndew.Tustin.CA.US / {uunet,attmail}!mtndew!friedl "No job is too big, no fee is too big" - Gary W. Keefe's company motto