[aklug] Re: Linux certification

From: Kenneth D Weinert <kenw@quarter-flash.com>
Date: Tue Dec 01 2009 - 11:53:05 AKST

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Leif Sawyer wrote:
> Damien Hull writes:

>>
>> if [ "$TEST" =3D "yes" ]
>
> that's a shortcut for the 'test' (or '[') command.
>
> test "$TEST" =3D "yes" # returns either 1 or 0

One quick note for the unwary. The program is /bin/test. [ is a link to
that program.

I haven't checked really recently, but a small change in your script can
cause you a problem:

if [ "$TEST" = "yes" ]

will work.

if [ "$TEST" = "yes"]

will not.

I believe it's related to the way /bin/test parses its arguments.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksVgjEACgkQH0OpnUzq8fDvYwCfUq2bMSI/8lM0Kwb5Ea1npzD7
IvIAnjT7c6IE/+UbOTwdEOtGikBzTLes
=NoNs
-----END PGP SIGNATURE-----
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Tue Dec 1 11:53:37 2009

This archive was generated by hypermail 2.1.8 : Tue Dec 01 2009 - 11:53:37 AKST