Subject: Re: sh script question
To: Gan Uesli Starling <oinkfreebiker@att.net>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 02/21/2002 12:49:41
On Wed, 20 Feb 2002, Gan Uesli Starling wrote:

> says:  <clip> if [ "x$PTY" = "x" ] </clip> that does not look right to
> me. I'm thinking maybe that little "x" in "x$PTY" does not belong? Does
> it?  The package installed it that way.

That's a common way for testing if a variable is blank. It is normal.

Probably [ -z "$PTY" ] is better. See the test(1) manual page. Some
shells, like bash, have this built in.

   Jeremy C. Reed
   http://www.reedmedia.net/