Bash crashes if you try to mapfile into an associative array

2009-10-16 Thread Nick Hobson
From: Nick Hobson To: bug-bash@gnu.org Subject: Bash crashes if you try to mapfile into an associative array Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='li

IFS=: breaks literal patterns with character classes

2009-10-16 Thread Enrique Perez-Terron
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' -DLOCALE DIR='/usr/share/locale' -DPA

PS1 prompt problem

2009-10-16 Thread Nils
I'm using bash 3.2 and I'd like to set my prompt to the following (inspired by the Opensolaris prompt for ksh93): PS1='$( spwd="${PWD/#${HOME}/~}" [[ ${#spwd} -gt 10 ]] && spwd="...${spwd: -10}" printf "%...@%s:%s%s " "\u" "\h" "${spwd}" "\$" termtitle="\...@\h:${spwd}"

Re: Bash crashes if you try to mapfile into an associative array

2009-10-16 Thread Chet Ramey
Nick Hobson wrote: > From: Nick Hobson > To: bug-bash@gnu.org > Subject: Bash crashes if you try to mapfile into an associative array > > Configuration Information [Automatically generated, do not change]: > Machine: i686 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCO

Re: PS1 prompt problem

2009-10-16 Thread Andreas Schwab
Nils writes: > Following a suggestion in comp.unix.shell putting the above code > contained in $() inside a separate function f and setting PS1='$( f )' > displays the $spwd correctly in both the prompt and xterm title, but > bash escapes like "\u", "\h" etc are not expanded any more You could p

Re: PS1 prompt problem

2009-10-16 Thread Chet Ramey
Nils wrote: > I'm using bash 3.2 and I'd like to set my prompt to the following > (inspired by the Opensolaris prompt for ksh93): > > PS1='$( > spwd="${PWD/#${HOME}/~}" > [[ ${#spwd} -gt 10 ]] && spwd="...${spwd: -10}" > printf "%...@%s:%s%s " "\u" "\h" "${spwd}" "\$" > termtitle="

Re: PS1 prompt problem

2009-10-16 Thread Nils
On 16 Okt., 21:18, Chet Ramey wrote: > Sort of.  I think you're overlooking the various expansion (and backslash > escaping) that's taking place with your prompt. > > Since you set the value of PS1 to literal string containing a command > substitution, the value will be expanded twice before being

Re: PS1 prompt problem

2009-10-16 Thread Chet Ramey
Nils wrote: > > Yes, that was the problem, I did not take into account that bash > expands $PS1 twice. No, it doesn't. It performs additional expansions besides those specified by Posix. > Is this double expansion even POSIX compliant? Yes. -- ``The lyf so short, the craft so long to lerne.'

Re: IFS=: breaks literal patterns with character classes

2009-10-16 Thread Chet Ramey
Enrique Perez-Terron wrote: > Bash Version: 4.0 > Patch Level: 23 > Release Status: release > > Description: > See the Repeat-by section. Character class [:graph:] appears not to > match as it > should, if IFS=':'. Why, or at what stage, is IFS used here? Thanks for the report. T

Re: Oddities when tab-completing filenames containing backticks

2009-10-16 Thread Chet Ramey
bash-b...@atu.cjb.net wrote: > Bash Version: 4.0 > Patch Level: 39 > Release Status: release > > Description: > >Also affects Bash 4.0.33. > >When a filename begins with a backtick ` then tab-completion works >as expected if you go \`, however if you try to tab-complete >t