BUG?: (or what's going on?) test for NL == NL fails (bash-4.3.39(3)-release)

2015-08-02 Thread Linda Walsh
printf "\n" |hexdump -C 0a printf "%s" $'\n'|hexdump -C 0a if [[ $(printf "\n") == $'\n' ]]; then echo T; else echo F; fi F just noticed the problem doesn't happen if I try to use '\t' (tab) printf "\t" |hexdump -C 09 printf "%s" $'

Re: BUG?: (or what's going on?) test for NL == NL fails (bash-4.3.39(3)-release)

2015-08-02 Thread Charles Daffern
On 02/08/15 20:30, Linda Walsh wrote: >> if [[ $(printf "\n") == $'\n' ]]; then echo T; else echo F; fi > F The command substitution operators ($(...) and `...`) strip all trailing linefeeds. You are left with an empty string here. The usual workarounds I see (where necessary) are hacks like thi

Re: BUG?: (or what's going on?) test for NL == NL fails (bash-4.3.39(3)-release)

2015-08-02 Thread Linda Walsh
also noticed this similar strange behavior: used 'ord'** for this test (trying to compare decimal val of chars) isatty () { test -c /proc/self/fd/1 ; } ord () { local nl=""; isatty && nl="\n"; printf "%d$nl" "'$1" ; } ord "$(printf "\n")" 0 ord "$(printf "\t")" 9 ord "$(printf " ")" 32 o

Re: BUG?: (or what's going on?) test for NL == NL fails (bash-4.3.39(3)-release)

2015-08-02 Thread Charles Daffern
On 02/08/15 21:30, Linda Walsh wrote: > Am just looking for an efficient way to test for 0x0a > as last char in a var, ... after another 20 minutes of > trying things at random, found this: > > > printf "%d\n" "'${a:0-1:1}'" > 10 > > Oddly, the final single quote in the string seems unnecessary.

Re: BUG?: (or what's going on?) test for NL == NL fails (bash-4.3.39(3)-release)

2015-08-02 Thread Chris F.A. Johnson
On Sun, 2 Aug 2015, Linda Walsh wrote: also noticed this similar strange behavior: used 'ord'** for this test (trying to compare decimal val of chars) isatty () { test -c /proc/self/fd/1 ; } ord () { local nl=""; isatty && nl="\n"; printf "%d$nl" "'$1" ; } ord () { local nl=""; isatty && nl="

Re: BUG?: (or what's going on?) test for NL == NL fails (bash-4.3.39(3)-release)

2015-08-02 Thread Linda Walsh
Charles Daffern wrote: On 02/08/15 20:30, Linda Walsh wrote: if [[ $(printf "\n") == $'\n' ]]; then echo T; else echo F; fi F The command substitution operators ($(...) and `...`) strip all trailing linefeeds. You are left with an empty string here. The usual workarounds I see (where nece

Bash 4.3.30 on AIX 6.1 filename completion

2015-08-02 Thread Steve Dahl
If on AIX 6.1, I mount an NFS volume exported from CentOS 6.7, Bash (4.3.30) is unable to do tab completion within that file system. If (for example) I search for files that I know exist, such as: ls -l /path/to/files/*.h ...no answers are returned even though ls -l /path/to/files ..