[EMAIL PROTECTED]
Configuration Information [Automatically generated, do not change]: Machine: i486 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I../bash -I../bash/include -I../bash/lib -g -O2 -Wall uname output: Linux cargocult 2.6.20-16-generic #2 SMP Fri Aug 31 00:55:27 UTC 2007 i686 GNU/Linux Machine Type: i486-pc-linux-gnu Bash Version: 3.2 Patch Level: 13 Release Status: release Description: After triggering file name completion for an argument to a command specified via an absolute path or relative path (i.e. anything other than a plain command name) inside backticks, file name completion appends a / to all file names (even if they are not directories). Repeat-By: complete -r # no programmable completion cd /tmp; touch example# any file will do `/bin/false examp# completes to example/ cat examp# completes to example/
Missing character when using ${VAR:1} and length(VAR)==1
From: root Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux Compiler: gcc -I/usr/src/packages/BUILD/bash-3.1 -L/usr/src/packages/BUILD/bash-3.1/../readline-5.1 Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux' -DCONF_MACHTYPE='x86_64-suse-linux' -DCONF_VENDOR='suse' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g -D_GNU_SOURCE -DRECYCLES_PIDS -Wall -pipe -g -fbranch-probabilities uname output: Linux erunb001 2.6.16.46-0.12-smp #1 SMP Thu May 17 14:00:09 UTC 2007 x86_64 x86_64 x86_64 GNU/Linux Machine Type: x86_64-suse-linux Bash Version: 3.1 Patch Level: 17 Release Status: release Description: there is missing a charachter when using the following: # TT="oo"; echo "l${TT:1}l" lol # TT="o"; echo "l${TT:1}l" l Repeat-By: every time Fix: In older versions it worked :-) also in 3.0.16 regards, Wolfgang Lauffher
Bash Commander: new project
Hello all, What do you think about extending bash functionality with visual two-panel file browser? Here is a new project to implement this: http://bashc.wiki.sourceforge.net/ Critique and suggestions are welcome. ___ Best wishes, Serge
Re: Bash Commander: new project
Serge Vakulenko wrote: > What do you think about extending bash functionality with visual > two-panel file browser? > Here is a new project to implement this: http://bashc.wiki.sourceforge.net/ > Critique and suggestions are welcome. I think it looks very much like midnight commander and other file manager applications. How does this differentiate itself? Bob
Re: Bash Commander: new project
> I think it looks very much like midnight commander and other file > manager applications. How does this differentiate itself? Bash commander is not a separate application, like others. It is the same good old bash, with added functionality. About 2klines of source code, or about 20kbytes of binary code added to bash. The commander layer lies somewhere in between the core shell and readline library. Right now I use bashc as a replacement of /bin/bash on my home Mac mini. ___ Serge
"[ -n ${emptyvariable} ]" returns success
Configuration Information [Automatically generated, do not change]: Machine: i386 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables uname output: Linux jik2.kamens.brookline.ma.us 2.6.22.5-71.fc7 #1 SMP Fri Aug 24 23:50:35 EDT 2007 i686 i686 i386 GNU/Linux Machine Type: i386-redhat-linux-gnu Bash Version: 3.2 Patch Level: 25 Release Status: release Description: foo= [ -n ${foo} ] && echo true Prints "true". Should probably print an error, since after the command is expanded there are only three arguments, so the final ] should be interpreted as the argument to -n, thus leaving the command with a missing ] terminator. Alternatively, if you want to be forgiving and allow the shell to realize that there was an empty variable before the ], then the command should return false, since the variable is empty. Repeat-By: See above.
Re: "[ -n ${emptyvariable} ]" returns success
[EMAIL PROTECTED] wrote: > foo= > [ -n ${foo} ] && echo true > > Prints "true". That's the correct behavior. > Should probably print an error, since after the command is > expanded there are only three arguments, so the final ] should > be interpreted as the argument to -n, thus leaving the command > with a missing ] terminator. No, the final ] is always taken to be the match for [. Anything in between has to be parsed consistently with that. In this case, it means that the test expression includes only one argument, "-n". Since there is only one, it is taken to be an operand, even if it happens to have the same spelling as an operator. The operand is tested for being nonempty, which "-n" is, so the result here is true. To avoid pitfalls like this, always quote variable expansions. The [[ command is also less tricky. paul
Re: "[ -n ${emptyvariable} ]" returns success
On 09/20/2007 07:46 PM, Paul Jarc wrote: [EMAIL PROTECTED] wrote: foo= [ -n ${foo} ] && echo true Prints "true". That's the correct behavior. OK, thanks for the explanation. It makes sense, although I think it's just a little gross. ;-) To avoid pitfalls like this, always quote variable expansions. The [[ command is also less tricky. Yes, I know that, but the person who wrote the code in which I noticed this issue apparently does not :-). Thanks again, jik
Re: Missing character when using ${VAR:1} and length(VAR)==1
Lauffher, Wolfgang wrote: > From: root > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux > Compiler: gcc -I/usr/src/packages/BUILD/bash-3.1 > -L/usr/src/packages/BUILD/bash-3.1/../readline-5.1 > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' > -DCONF_OSTYPE='linux' -DCONF_MACHTYPE='x86_64-suse-linux' > -DCONF_VENDOR='suse' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL > -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -O2 -fmessage-length=0 -Wall > -D_FORTIFY_SOURCE=2 -g -D_GNU_SOURCE -DRECYCLES_PIDS -Wall -pipe -g > -fbranch-probabilities > uname output: Linux erunb001 2.6.16.46-0.12-smp #1 SMP Thu May 17 14:00:09 > UTC 2007 x86_64 x86_64 x86_64 GNU/Linux > Machine Type: x86_64-suse-linux > > Bash Version: 3.1 > Patch Level: 17 > Release Status: release > > Description: > there is missing a charachter when using the following: > # TT="oo"; echo "l${TT:1}l" > lol > # TT="o"; echo "l${TT:1}l" > l I can't reproduce this; I get `ll' from the second expansion. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Live Strong. No day but today. Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/
Re: Missing character when using ${VAR:1} and length(VAR)==1
Chet Ramey wrote: Description: there is missing a charachter when using the following: # TT="oo"; echo "l${TT:1}l" lol # TT="o"; echo "l${TT:1}l" l I can't reproduce this; I get `ll' from the second expansion. I can't reproduce it on a 2.05b: $ TT="o"; echo "l${TT:1}l" ll But I can reproduce it (or at least something weird) on a 3.1.17(1)-release: $ TT="o"; echo "l${TT:1}l" lXl (where X is a non-printable character for my terminal here, maybe multibyte) However, I can't reproduce it on the latest build, so I assume it's fixed. J.
Re: Missing character when using ${VAR:1} and length(VAR)==1
On Fri, Sep 21, 2007 at 05:16:03AM +0200, Jan Schampera wrote: > Chet Ramey wrote: > >>> Description: >>> there is missing a charachter when using the following: >>> # TT="oo"; echo "l${TT:1}l" >>> lol >>> # TT="o"; echo "l${TT:1}l" >>> l >> I can't reproduce this; I get `ll' from the second expansion. > > I can't reproduce it on a 2.05b: > $ TT="o"; echo "l${TT:1}l" > ll > > But I can reproduce it (or at least something weird) on a > 3.1.17(1)-release: > $ TT="o"; echo "l${TT:1}l" > lXl > (where X is a non-printable character for my terminal here, maybe > multibyte) [...] Same here. The character is DEL: ~$ bash -c 'TT="o"; echo "l${TT:1}l"' | od -c 000 l 177 l \n 004 ~$ locale charmap ISO-8859-15 ~$ bash --version GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc. ~/install/bash-3.2$ ./bash -c 'TT="o"; echo "l${TT:1}l"' | od -c 000 l l \n 003 ~/install/bash-3.2$ ./bash --version GNU bash, version 3.2.25(2)-release (i686-pc-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc. (why doesn't the Copyright extend to 2007, BTW?) -- Stéphane