Re: [nicolas.io...@m4x.org: Re: Bash 5 change in behavior and SELinux]

2019-02-25 Thread Chet Ramey
21:32:13 +0100 > From: Nicolas Iooss > To: Dominick Grift > Cc: seli...@vger.kernel.org > Subject: Re: Bash 5 change in behavior and SELinux > > On Sun, Feb 24, 2019 at 7:37 PM Dominick Grift > wrote: >> >> On Sun, Feb 24, 2019 at 07:17:33PM +0100, Nicolas

Re: [nicolas.io...@m4x.org: Re: Bash 5 change in behavior and SELinux]

2019-02-24 Thread Grisha Levit
On Sun, Feb 24, 2019 at 5:14 PM Dominick Grift wrote: > > Simple test: This seems to be the same as https://lists.gnu.org/archive/html/bug-bash/2019-01/msg00276.html https://lists.gnu.org/archive/html/bug-bash/2019-02/msg0.html Which has been fixed in the devel branch

Re: [nicolas.io...@m4x.org: Re: Bash 5 change in behavior and SELinux]

2019-02-24 Thread Dominick Grift
e came up with the > following analysis: > > - Forwarded message from Nicolas Iooss - > > Date: Sun, 24 Feb 2019 21:32:13 +0100 > From: Nicolas Iooss > To: Dominick Grift > Cc: seli...@vger.kernel.org > Subject: Re: Bash 5 change in behavior and SELinux > > On

[nicolas.io...@m4x.org: Re: Bash 5 change in behavior and SELinux]

2019-02-24 Thread Dominick Grift
analysis: - Forwarded message from Nicolas Iooss - Date: Sun, 24 Feb 2019 21:32:13 +0100 From: Nicolas Iooss To: Dominick Grift Cc: seli...@vger.kernel.org Subject: Re: Bash 5 change in behavior and SELinux On Sun, Feb 24, 2019 at 7:37 PM Dominick Grift wrote: > > On Sun, Feb 24, 2019

Re: Change in behavior

2016-12-13 Thread Vladimir Marek
> >> Posix says a word expansion error shall cause a non-interactive shell to > >> exit: > >> > >> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_01 > >> > >> Bash posix mode changed as the result of this report: > >> > >> http://lists.gnu.org/archive/html/bug-ba

Re: Change in behavior

2016-12-13 Thread Chet Ramey
On 12/13/16 10:37 AM, Vladimir Marek wrote: >> Posix says a word expansion error shall cause a non-interactive shell to >> exit: >> >> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_01 >> >> Bash posix mode changed as the result of this report: >> >> http://lists

Re: Change in behavior

2016-12-13 Thread Vladimir Marek
> Posix says a word expansion error shall cause a non-interactive shell to > exit: > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_01 > > Bash posix mode changed as the result of this report: > > http://lists.gnu.org/archive/html/bug-bash/2015-08/msg00013.h

Re: Change in behavior

2016-12-13 Thread Chet Ramey
On 12/13/16 10:08 AM, Vladimir Marek wrote: > Hi, > > by coincidence I found change in behavior in how bash treats syntax > error. Can you see the difference on your machines too? > > $ cat configure > set -o posix > echo ${0.8} > echo after > > $ bash a.sh &

Re: Change in behavior

2016-12-13 Thread Greg Wooledge
On Tue, Dec 13, 2016 at 09:16:12AM -0600, Eduardo Bustamante wrote: > On Tue, Dec 13, 2016 at 9:08 AM, Vladimir Marek > wrote: > [...] > > $ cat configure > > set -o posix > > echo ${0.8} > > echo after > > > > $ bash a.sh > > 3.2.52(1)-release > > a.sh: line 3: ${0.8}: bad substitution > > after

Re: Change in behavior

2016-12-13 Thread Vladimir Marek
> > $ cat configure > > set -o posix > > echo ${0.8} > > echo after > > > > $ bash a.sh > > 3.2.52(1)-release > > a.sh: line 3: ${0.8}: bad substitution > > after > Is `a.sh' a copy of `configure'? Oh, yes, sorry, it's the same file. It's a part of libvisual-plugins's configure script. --

Re: Change in behavior

2016-12-13 Thread Eduardo Bustamante
On Tue, Dec 13, 2016 at 9:08 AM, Vladimir Marek wrote: [...] > $ cat configure > set -o posix > echo ${0.8} > echo after > > $ bash a.sh > 3.2.52(1)-release > a.sh: line 3: ${0.8}: bad substitution > after Is `a.sh' a copy of `configure'?

Change in behavior

2016-12-13 Thread Vladimir Marek
Hi, by coincidence I found change in behavior in how bash treats syntax error. Can you see the difference on your machines too? $ cat configure set -o posix echo ${0.8} echo after $ bash a.sh 3.2.52(1)-release a.sh: line 3: ${0.8}: bad substitution after $ bash a.sh 4.3.46(1)-release build/i86

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-11-09 Thread Chet Ramey
On 11/7/16 4:49 AM, Dan Douglas wrote: > On Sun, Nov 6, 2016 at 3:46 PM, Chet Ramey wrote: >> On 11/1/16 5:57 AM, Dan Douglas wrote: >>> On a possibly related note, would you consider adjusting +, :+, -, :-, >>> as in "${var[@]+word}" to align with the meaning of [[ -v var[@] ]] as >>> discussed i

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-11-07 Thread Dan Douglas
On Sun, Nov 6, 2016 at 3:46 PM, Chet Ramey wrote: > On 11/1/16 5:57 AM, Dan Douglas wrote: >> On a possibly related note, would you consider adjusting +, :+, -, :-, >> as in "${var[@]+word}" to align with the meaning of [[ -v var[@] ]] as >> discussed in >> https://lists.gnu.org/archive/html/bug-

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-11-06 Thread Chet Ramey
On 11/1/16 5:57 AM, Dan Douglas wrote: > On Mon, Oct 24, 2016 at 8:25 AM, Chet Ramey wrote: >> On 10/21/16 5:41 PM, L. A. Walsh wrote: >>> On 4.3 and earlier, at least on arrays, one could have >>> the illusion of this working w/o complaint -- and returning >>> 0 when the array was 0-len or unset,

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-11-01 Thread Dan Douglas
On Mon, Oct 24, 2016 at 8:25 AM, Chet Ramey wrote: > On 10/21/16 5:41 PM, L. A. Walsh wrote: >> On 4.3 and earlier, at least on arrays, one could have >> the illusion of this working w/o complaint -- and returning >> 0 when the array was 0-len or unset, or the array length, >> otherwise: >> >> >>

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-10-29 Thread L. A. Walsh
Chet Ramey wrote: On 10/29/16 2:04 AM, L. A. Walsh wrote: You can claim a feature is a certain way because posix requires it when you are operating in posix-only mode. Not actually true. I can claim bash implements a particular feature the way bash implements it. --- True, but

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-10-29 Thread Chet Ramey
On 10/29/16 2:04 AM, L. A. Walsh wrote: > > > Chet Ramey wrote: >> Come on, don't be willfully obtuse. You know better than this. Posix mode >> doesn't mean "turning it off does everything the way Linda wants." >> > No, but claiming posix as a backing for features running that are > not runnin

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-10-28 Thread L. A. Walsh
Chet Ramey wrote: Come on, don't be willfully obtuse. You know better than this. Posix mode doesn't mean "turning it off does everything the way Linda wants." No, but claiming posix as a backing for features running that are not running with posix-mode set, is equally obtuse. Bash is not l

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-10-28 Thread Chet Ramey
On 10/28/16 3:43 PM, L. A. Walsh wrote: > >Please, I'm not running in posix mode, so how would their rules > apply? Because you're using `bash', not `walsh'? Bash is a posix shell. Would the bash documentation convince you? You could go read that instead. > Just because posix defines

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-10-28 Thread L. A. Walsh
Chet Ramey wrote: On 10/24/16 7:32 PM, L. A. Walsh wrote: I don't understand the ambiguity. If param= "#obj[@]", then it is clear to me that the user wants the length of an array named "obj". Stop there. In something like ${#obj[@]}, `param' is `obj[@]'. The `${#param}' is a c

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-10-28 Thread Chet Ramey
On 10/24/16 7:32 PM, L. A. Walsh wrote: >I don't understand the ambiguity. If param= "#obj[@]", then it > is clear to me that the user wants the length of an array named "obj". Stop there. In something like ${#obj[@]}, `param' is `obj[@]'. The `${#param}' is a clearly-defined word expansio

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-10-24 Thread L. A. Walsh
Chet Ramey wrote: On 10/21/16 5:41 PM, L. A. Walsh wrote: [previously] one could have the illusion of this working w/o complaint -- and returning 0 when the array was 0-len or unset, or the array length, otherwise: echo ${#array[@]:-0} But I note it only seemed to work in arrays, and in

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-10-24 Thread Chet Ramey
On 10/21/16 5:41 PM, L. A. Walsh wrote: > On 4.3 and earlier, at least on arrays, one could have > the illusion of this working w/o complaint -- and returning > 0 when the array was 0-len or unset, or the array length, > otherwise: > > > echo ${#array[@]:-0} > > But I note it only seemed to wor

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-10-24 Thread Greg Wooledge
On Fri, Oct 21, 2016 at 09:19:08PM -0700, L. A. Walsh wrote: > Eduardo Bustamante wrote: > >what's wrong with?: > >echo ${#array[@]} > Not when "-u" is set, which I often have on to help catch misspellings. > > set -u > echo ${#array[@]} > bash: array: unbound variable See http://mywiki.wooledge

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-10-21 Thread Eduardo Bustamante
what's wrong with?: echo ${#array[@]} It will return: - With array=(1 2 3) -> 3 - With array=() -> 0 - With unset array -> 0 - With declare -a array -> 0 Seems to do what you're looking for.

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-10-21 Thread L. A. Walsh
Eduardo Bustamante wrote: what's wrong with?: echo ${#array[@]} It will return: - With array=(1 2 3) -> 3 - With array=() -> 0 - With unset array -> 0 - With declare -a array -> 0 Seems to do what you're looking for. Not when "-u" is set, which I often have on to help catch misspellings

4.4 change in behavior from 4.3: how to catch unset when using ${#length}

2016-10-21 Thread L. A. Walsh
On 4.3 and earlier, at least on arrays, one could have the illusion of this working w/o complaint -- and returning 0 when the array was 0-len or unset, or the array length, otherwise: echo ${#array[@]:-0} But I note it only seemed to work in arrays, and in 4.4 gets a syntax error: echo ${#ar

Re: change in behavior starting with bash-4.3_p14 and $@ in [[...]]

2014-08-13 Thread Chet Ramey
On 8/13/14, 10:09 AM, Greg Wooledge wrote: > On Wed, Aug 13, 2014 at 09:47:51AM -0400, Chet Ramey wrote: >> On 8/12/14, 11:05 PM, Mike Frysinger wrote: >>> foo=(0 0 0); [[ -z ${foo[@]#0} ]]; echo $? > >> Word splitting is >> suppressed inside [[, so the array expands to a single word ("0 0 0"), th

Re: change in behavior starting with bash-4.3_p14 and $@ in [[...]]

2014-08-13 Thread Greg Wooledge
On Wed, Aug 13, 2014 at 09:47:51AM -0400, Chet Ramey wrote: > On 8/12/14, 11:05 PM, Mike Frysinger wrote: > > foo=(0 0 0); [[ -z ${foo[@]#0} ]]; echo $? > Word splitting is > suppressed inside [[, so the array expands to a single word ("0 0 0"), the > 0s are removed, leaving " " That doesn't sou

Re: change in behavior starting with bash-4.3_p14 and $@ in [[...]]

2014-08-13 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 8/12/14, 11:05 PM, Mike Frysinger wrote: > simple enough code: > foo=(0 0 0); [[ -z ${foo[@]#0} ]]; echo $? > > with bash-4.3_p13 and older, this would show 0. starting with bash-4.3_p14, > this now shows 1. It's intentional, and part of the sam

change in behavior starting with bash-4.3_p14 and $@ in [[...]]

2014-08-12 Thread Mike Frysinger
simple enough code: foo=(0 0 0); [[ -z ${foo[@]#0} ]]; echo $? with bash-4.3_p13 and older, this would show 0. starting with bash-4.3_p14, this now shows 1. i can't tell from the thread whether this was intentional: https://lists.gnu.org/archive/html/help-bash/2014-04/msg4.html -mike signa