[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash Problems & Suggestions
From: |
Paul Jarc |
Subject: |
Re: Bash Problems & Suggestions |
Date: |
Sun, 22 Feb 2004 01:27:57 -0500 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) |
Christopher Buckley <mallardproductions@yahoo.com> wrote:
> EXAMPLE:
> if ["$LOGNAME"=="root"]; then
>
> will NOT work. it must be:
>
> if [ "$LOGNAME"=="root" ]; then
You need even more whitespace than that.
if [ "$LOGNAME" == "root" ]; then
Otherwise, the test will always be true, since there will be only one
argument between [ and ], and a single argument is true when it is not
empty.
paul