Re: 'test' builtin of bash returns wrong value for '! -a FILE' operation

2010-11-08 Thread Greg Wooledge
On Fri, Nov 05, 2010 at 04:24:23PM -0500, Jonathan Nieder wrote: > >>> Please try > >>> % bash -c 'test ! -a . && echo true' > >>> and compare with the result of > >>> % bash -c '/usr/bin/test ! -a . && echo true' imadev:~$ bash -c 'test ! -a . && echo true' true imadev:~$ bash -c '/usr/bin/te

Re: Commands executed with $($prog) do not run properly

2010-11-08 Thread Greg Wooledge
On Sat, Nov 06, 2010 at 03:09:08AM +0100, Hans-Georg Bork wrote: > $ prog='find /test -type d ! -wholename "/test"' > $ echo $prog > find /test -type d ! -wholename "/test" > $ echo "$($prog)" > /test > /test/c > /test/b > /test/d > /test/a > $ This is an error in your script, not in bash. You'r

Re: crash when using associative array and integer variable

2010-11-08 Thread Roman Rakus
On 07/28/2010 08:46 AM, Roman Rakus wrote: Repeated in the bash-4.0.38 and bash-4.1.7 by the script; #!/bin/bash typeset -Ai s y='*' z='[' s[$y]=1 s[$z]=2 (( s[$z] = s[$z] + ${s[$y]} )) (( s[$y] = s[$y] + ${s[$z]} )) [[ ${s[$y]} = 4 ]] && echo "ok" FIX: added check; diff -up bash-4.1/var

Re: Commands executed with $($prog) do not run properly

2010-11-08 Thread Hans-Georg Bork
Hi, On Mon, 2010-11-08 at 08:51 -0500, Greg Wooledge wrote: > On Sat, Nov 06, 2010 at 03:09:08AM +0100, Hans-Georg Bork wrote: > > $ prog='find /test -type d ! -wholename "/test"' > > $ echo $prog > > find /test -type d ! -wholename "/test" > > $ echo "$($prog)" > > /test > > /test/c > > /test/b >

Re: crash when using associative array and integer variable

2010-11-08 Thread Chet Ramey
On 11/8/10 9:18 AM, Roman Rakus wrote: > On 07/28/2010 08:46 AM, Roman Rakus wrote: >> Repeated in the bash-4.0.38 and bash-4.1.7 by the script; >> #!/bin/bash >> >> typeset -Ai s >> y='*' >> z='[' >> s[$y]=1 >> s[$z]=2 >> (( s[$z] = s[$z] + ${s[$y]} )) >> (( s[$y] = s[$y] + ${s[$z]} )) >> [[ ${s[

Re: Commands executed with $($prog) do not run properly

2010-11-08 Thread Greg Wooledge
On Mon, Nov 08, 2010 at 03:26:10PM +0100, Hans-Georg Bork wrote: > if this is true, then please explain the differences between > $ find /test -type d ! -wholename "/test" > (/test not shown) > and > $ prog='find /test -type d ! -wholename "/test"' > $ echo $prog > find /tes

Re: Commands executed with $($prog) do not run properly

2010-11-08 Thread Andreas Schwab
Hans-Georg Bork writes: > if this is true, then please explain the differences between > $ find /test -type d ! -wholename "/test" > (/test not shown) > and > $ prog='find /test -type d ! -wholename "/test"' > $ echo $prog > find /test -type d ! -wholename "/test" >

Re: 'test' builtin of bash returns wrong value for '! -a FILE' operation

2010-11-08 Thread Chet Ramey
> "help test" says: > > See the bash manual page bash(1) for the handling of > parameters (i.e., missing parameters). > > which does not really tempt me to look at the manual. You should probably ask the person who added that to Debian's version of bash. > bash(1) says: > > E

Re: Commands executed with $($prog) do not run properly

2010-11-08 Thread Hans-Georg Bork
Hi, On Mon, 2010-11-08 at 09:49 -0500, Greg Wooledge wrote: > On Mon, Nov 08, 2010 at 03:26:10PM +0100, Hans-Georg Bork wrote: > > if this is true, then please explain the differences between > > $ find /test -type d ! -wholename "/test" > > (/test not shown) > > and > > $ prog='find /test

Negative or zero arguments to yank-last-arg in bound keystrokes

2010-11-08 Thread Dennis Williamson
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE

Re: Ctrl- does nothing

2010-11-08 Thread humpty
Hello, `clear' command works. $TERM is linux, and xterm: I've tested in both TTYs, and X11 $ bind -p | grep clear "\C-l": clear-screen I've tried to un-bind (bind -r ^L), at this moment TTY beeps on Ctrl-L and re-bind (bind ^L:clear-screen): no beep, just new line the terminal can C-l, I use i

Bash History Files

2010-11-08 Thread Ajay Jain
Hi, I use bash via Xterm. As a result I open multiple Xterm windows. When I type commands on the shell, they get saved only for that particular shell's history. I want to be able to collate that history, so that if I type commands on shell 1, I can search the same in the history of shell 2 in real