Re: Behavior of ${var/*/text} has changed

2016-09-16 Thread Eric Pruitt
On Fri, Sep 16, 2016 at 03:22:29PM -0400, Greg Wooledge wrote: > Off hand I'd say the bash 4.4 behavior is correct. * matches 0 or > more characters, so it should match an empty or undefined variable. Yes, I agree that the Bash 4.4 behavior is more reasonable, but I think the change at least

Re: Behavior of ${var/*/text} has changed

2016-09-16 Thread Eric Pruitt
On Fri, Sep 16, 2016 at 12:30:59PM -0700, Eric Pruitt wrote: > > That, or ${VAR:+not empty} which is how I suggest testing for variable > > set-and-not-empty-ness. > > I'm aware of that construct, but that doesn't do what I want unless I'm > missing something; I don't want to change the value of

Re: Behavior of ${var/*/text} has changed

2016-09-16 Thread Eric Pruitt
On Fri, Sep 16, 2016 at 03:45:39PM -0400, Greg Wooledge wrote: > On Fri, Sep 16, 2016 at 12:38:20PM -0700, Eric Pruitt wrote: > > first time. However, that construct still won't work because if a > > variable is defined, it will still choose "not empty:" > > > > ericpruitt@sinister:~$ X= > >

Behavior of ${var/*/text} has changed

2016-09-16 Thread Eric Pruitt
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'

Re: Behavior of ${var/*/text} has changed

2016-09-16 Thread Greg Wooledge
On Fri, Sep 16, 2016 at 12:06:53PM -0700, Eric Pruitt wrote: > Bash 4.3: > ericpruitt@sinister:~$ VAR= > ericpruitt@sinister:~$ echo ${VAR/*/VAR was not empty} > > Bash 4.4: > ericpruitt@sinister:~$ VAR= > ericpruitt@sinister:~$ echo ${VAR/*/VAR was not

build failure with enable-static-link

2016-09-16 Thread Ben
Hello, bash-4.4 doesn't build with --enable-static-link. Buidling with an additional --without-bash-malloc makes it work. /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libc.a(malloc.o): In function `free': (.text+0x5f20): multiple definition of `free'

PS0 issue with escape sequence

2016-09-16 Thread Ben
Hello, using bash-4.4, setting PS0 to '\[\033[1;36m\]started at \t\[\033[0m\]\n' makes it output PS0 with a non-printable \x01\x02 prefix and suffix. 01 02 73 74 61 72 74 65 64 20 61 74 20 30 33 3a |..started at 03:| 0010 31 38 3a 30 37 01 02 0a

Re: Bash 4.4 doesn't compile on GCC 5.2(easy steps to reproduce)

2016-09-16 Thread Andreas Schwab
On Sep 16 2016, Lilian Moraru wrote: > Hello, > > I tried to compile Bash 4.4 in Habitat(habitat.sh): > https://github.com/habitat-sh/core-plans/tree/master/bash and it fails to > compile with the following messages: > ``` > gcc -DPROGRAM='"bash"'

Bash 4.4 doesn't compile on GCC 5.2(easy steps to reproduce)

2016-09-16 Thread Lilian Moraru
Hello, I tried to compile Bash 4.4 in Habitat(habitat.sh): https://github.com/habitat-sh/core-plans/tree/master/bash and it fails to compile with the following messages: ``` gcc -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"x86_64"' -DCONF_OSTYPE='"linux-gnu"' -DCONF_MACHTYPE='"x86_64-unknown-linux-gnu"'

Re: Command substitution with null bytes generates warning

2016-09-16 Thread Greg Wooledge
On Thu, Sep 15, 2016 at 10:51:22PM -0700, Eric Pruitt wrote: > Fix: > Is this even an intentional change? I looked at some of the other > internal_warning invocations, and they were commented out using "#if 0 > ... > #endif." In 4.4-beta2, I see them in subst.c and parse.y and

Bash-4.4 Release available

2016-09-16 Thread Chet Ramey
Introduction The first public release of bash-4.4 is now available with the URLs ftp://ftp.cwru.edu/pub/bash/bash-4.4.tar.gz ftp://ftp.gnu.org/pub/gnu/bash/bash-4.4.tar.gz and from the GNU git repository and the usual GNU mirror sites. Bash is the GNU Project's Bourne Again SHell,

Readline-7.0 Release available

2016-09-16 Thread Chet Ramey
The first public release of the GNU Readline library, version 7.0, is now available for FTP with the URLs ftp://ftp.cwru.edu/pub/bash/readline-7.0.tar.gz ftp://ftp.gnu.org/pub/gnu/readline/readline-7.0.tar.gz and from the GNU git repository and the usual GNU mirror sites. GNU Readline is a

Re: Behavior of ${var/*/text} has changed

2016-09-16 Thread Greg Wooledge
On Fri, Sep 16, 2016 at 12:38:20PM -0700, Eric Pruitt wrote: > first time. However, that construct still won't work because if a > variable is defined, it will still choose "not empty:" > > ericpruitt@sinister:~$ X= > ericpruitt@sinister:~$ echo ${X+Not empty} > Not empty Then you

Re: Behavior of ${var/*/text} has changed

2016-09-16 Thread Greg Wooledge
On Fri, Sep 16, 2016 at 12:30:59PM -0700, Eric Pruitt wrote: > PS1="${SSH_TTY/?*/\\u@\\h:}\\W${jobs/?*/ [\\j]}\\$ " > > In this example, I want to show the username and hostname if SSH_TTY is > set and not empty, but I do not want to modify its value. I am also > showing the number of

[minor] [[ "\\" =~ [^]"."] ]] returns false

2016-09-16 Thread Stephane Chazelas
That's a special case of the [[ "\\" =~ ["."] ]] returning true (because bash called regcomp("[\\.]") instead of regcomp("[.]") I had reported some time ago and was then fixed. Here. It's similar: $ bash -c '[[ "\\" =~ [^]"."] ]]' || echo unexpected unexpected $ ltrace -e regcomp bash -c '[[