Bug in test [ $n != 0 ]; then

Sean Estabrooks seanlkml at sympatico.ca
Sat Jun 12 17:13:03 UTC 2004


On Sat, 12 Jun 2004 11:07:40 -0600
clemens at dwf.com wrote:

> I have a script here that ran fine up thru Fc2T1, but 
> test (I assume) is now complaining.
> 
> The error is:
>     ./update2.sh: line 126: [: too many arguments
> 
> The line in question is:
>     if [ $n9 -ne 0 ]; then
> 
> I tried ${n9} but got the same error.
> 
> I dont see any error, and it has worked up to now, anyone else
> see a problem?

Reg,

Likely $n9 is being expanded to something with a whitespace in it
and then being interpreted as multiple arguments, try:

if [ "$n9" -ne 0 ]; then

Cheers,
Sean





More information about the fedora-list mailing list