Re: if, -n

2009-02-01 Thread coubeatczech


Jan Schampera wrote:
> 
> coubeatczech wrote:
> 
>> c...@notas:~$ if [ -z $variable ]; then echo true; fi
>> true
>> c...@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
> 
> 
> 
> 
Thanks, I'm understanding it now.
-- 
View this message in context: 
http://www.nabble.com/if%2C--n-%3Cstring%3E-tp21764081p21774953.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.





Re: if, -n

2009-02-01 Thread Jan Schampera
coubeatczech wrote:

> c...@notas:~$ if [ -z $variable ]; then echo true; fi
> true
> c...@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




Re: if, -n

2009-02-01 Thread coubeatczech



Eric Blake wrote:
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> According to coubeatczech on 1/31/2009 7:24 AM:
>> c...@notas:~$ variable=
>> c...@notas:~$ if [ -n $variable ]; then echo true; fi
>> true
> 
> This is equivalent to 'if [ -n ]; then echo true; fi'; in other words,
> because there is only one argument ("-n"), and it is not empty, it is
> true.
> 
> You meant to use quotes, to guarantee that there are two arguments, as in:
> 
> if [ -n "$variable" ]; then echo true; fi
> 
> - --
> Don't work too hard, make some time for fun as well!
> 
> Eric Blake e...@byu.net
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (Cygwin)
> Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkmFCUMACgkQ84KuGfSFAYCU6ACgj4hHK1Cxuk/gwI6QPo6xU0Ng
> 6KIAoMx3sk6bvV8YHGssez2s2vT7s45e
> =VLoa
> -END PGP SIGNATURE-
> 
> 
> 
> 
Ok, thanks got it now
-- 
View this message in context: 
http://www.nabble.com/if%2C--n-%3Cstring%3E-tp21764081p21774961.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.





bash 3.2 and bash 4.0 (RC1) fail to build statically

2009-02-01 Thread alex
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc

Description:
http://pastebin.com/f476b80da
configured via: http://pastebin.com/m62b92718

Adding --enable-minimal doesn't fix the issue which means these versions
basically can't be used as a statically-linked root shell?  Ideally we'd
be able to have a *fully* functional Bash statically linked though ;)

Reported in #bash on 1st February 2009, bug request made by 'ferret'.
We've both looked and can't find a duplicate for this one.

Any hot tips on how to get this to build?  Target system is an i486
box running Debian GNU/Linux but I've also got x86_64 boxes which will
need a statically-linked Bash compiling :-)

Thanks very much. -- astinus

Repeat-By:
configure
compile
watch it fail :)




Re: Different COMP_WORDS array values with exactly the same commandline

2009-02-01 Thread Chet Ramey
wer...@suse.de wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: i586
> OS: linux-gnu
> Compiler: gcc -I/usr/src/packages/BUILD/bash-3.2 
> -L/usr/src/packages/BUILD/bash-3.2/../readline-5.2
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i586' 
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i586-suse-linux-gnu' 
> -DCONF_VENDOR='suse' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
> -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -O2 -march=i586 -mtune=i686 
> -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector 
> -funwind-tables -fasynchronous-unwind-tables -g -D_LARGEFILE64_SOURCE 
> -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DRECYCLES_PIDS -Wall -g -std=gnu89 
> -Wextra -Wno-unprototyped-calls -Wno-switch-enum -pipe
> uname output: Linux boole 2.6.27.7-9-pae #1 SMP 2008-12-04 18:10:04 +0100 
> i686 i686 i386 GNU/Linux
> Machine Type: i586-suse-linux-gnu
> 
> Bash Version: 3.2
> Patch Level: 48
> Release Status: release
> 
> Description:
> Different ${#comp_wor...@]} values with exactly the same commandline
> due not restored state of complete variables.

Thanks for the report and fix.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/