bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: if, -n <string>


From: Jan Schampera
Subject: Re: if, -n <string>
Date: Sun, 01 Feb 2009 12:24:01 +0100
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

coubeatczech wrote:

> coub@notas:~$ if [ -z $variable ]; then echo true; fi
> true
> coub@notas:~$
> 
> Can anybody explain to me this behaviour? I would expect not any output in
> the last command...? The variable is set to zero and there is the condition
> is still true...?

http://bash-hackers.org/wiki/doku.php/commands/classictest#number_of_arguments_rules

You'd need some quoting.

Jan aka TheBonsai




reply via email to

[Prev in Thread] Current Thread [Next in Thread]