Re: Bash-4.0-rc1 available for FTP

2009-01-31 Thread Nicolas
 Bash versions other than `release' are built with extensive extra arena
 and allocation checking enabled in the bash malloc.

Thanks for pointing this out.

Here are the new results:

Bash 4.0, with bash malloc:
 * eval `dircolors`: 0.138s
 * source /etc/bash_completion: 0.735s

Bash 4.0, without bash malloc:
 * eval `dircolors`: 0.135s (slightly slower than with debugging on, I
checked several times to be sure. This is very surprising...)
 * source /etc/bash_completion: 0.702s

Without bash malloc, the results are close to the results with
debugging on. The results with bash malloc are far better now, but
still slightly behind those with libc malloc, on my computer.

In addition, in builtins/evalstring.c, line 271, an itrace call is not
enclosed between #if defined (DEBUG) and #endif, as it should be.

With my computer at normal speed (with the 'ondemand' governor),
starting a new shell (and running my .bashrc) now takes around 0.4s,
while it took 0.6s with Bash 3.2. This is enough to feel a difference!

Nicolas




Re: if, -n string

2009-01-31 Thread Eric Blake
-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-