Re: Fwd: Patch for full hostname in PS1

2014-06-09 Thread Eric Blake
On 06/08/2014 02:40 PM, Renato Silva wrote: > > Along with the patch I'm attaching the *nix build I used in my tests. The > patch is against current head [5]. I'm also attaching a sample program > "canonname" demonstrating the use of the new API (web [6], source code, > windows, *nix). Feedback i

Inconsistent string comparison operators n and z

2014-06-09 Thread Thibault, Daniel
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKA

Re: Inconsistent string comparison operators n and z

2014-06-09 Thread Dennis Williamson
On Jun 9, 2014 10:41 AM, "Thibault, Daniel" wrote: > > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-g

Re: Inconsistent string comparison operators n and z

2014-06-09 Thread Eric Blake
On 06/09/2014 07:11 AM, Thibault, Daniel wrote: > Description: > The string comparison operators -n and -z are designed to be mutually > complementary. ! -z should be interchangeable with -n and ! -n should be > interchangeable with -z. But such is not the case. Consider these lines: The bug

Re: Inconsistent string comparison operators n and z

2014-06-09 Thread Greg Wooledge
On Mon, Jun 09, 2014 at 01:11:31PM +, Thibault, Daniel wrote: > Consider these lines: > > $ if [ -z `pgrep pname` ]; then echo "not r" ; else echo "r" ; fi > $ if [ ! -z `pgrep pname` ]; then echo "r" ; else echo "not r" ; fi > $ if [ -n `pgrep pname` ]; then echo "r" ; else echo "not r" ;

dotgob+extglob bug

2014-06-09 Thread Ian Kelling
Running this script with your own bash path demonstrates the bug. #!/home/ian/opt/bash/bash --norc shopt -s extglob shopt -s dotglob cd $(mktemp -d) mkdir a touch a/.b touch a/c echo a/!(.b) output: a/. a/.. a/c this happens with all bash versions 4.3+ (latest is patch 18). before that, the out

'time' not recognized as reserved when first word after 'if'

2014-06-09 Thread Dale R. Worley
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share

Re: 'time' not recognized as reserved when first word after 'if'

2014-06-09 Thread Dan Douglas
On Mon, Jun 9, 2014 at 7:51 PM, Dale R. Worley wrote: > But if I add braces around the condition, 'time' is recognized: That's not too surprising. That "!" is unaffected is. "if ! ! time :; then ..." is an equivalent but working pipeline. "if time { :; };" should also be valid but time isn't reco