man page: minor problem regarding ${parameter@operator}

2017-10-10 Thread Clark Wang
See: ${parameter@operator} Parameter transformation. The expansion is either a transforma- tion of the value of parameter or information about parameter itself, depending on the value of operator. Each operator is a single

Why are long functions slower?

2017-10-10 Thread Bernhard M. Wiedemann
Hi, today I was debugging performance issues with a 200KB bash script [1] with bash-4.3 and 4.4 and it seems that much of it came from a function call that took 0.1 seconds (and it was done in a loop for 37000 files) even though it basically just consisted of an if [[ 0 != 0 ]] ; then I also

Re: glibc [BZ #22145]: {p,ty}fds and mount namespaces

2017-10-10 Thread Chet Ramey
On 10/9/17 10:37 AM, Christian Brauner wrote: > A common scenario where this happens is with /dev/console in containers. > Usually container runtimes/managers will call openpty() on a ptmx device in > the > host's mount namespace to safely allocate a {p,t}ty master-slave pair since > they >

Re: Array not defined when being set inline

2017-10-10 Thread Chet Ramey
On 10/10/17 9:06 AM, Dan Douglas wrote: > Bash parses the array assignment as though it were valid while reading > words, assignments, and redirects of the command. Because at the time the parser reads the assignment, it has to assume that it's a candidate for compound assignment. It's only

Re: Array not defined when being set inline

2017-10-10 Thread Greg Wooledge
On Tue, Oct 10, 2017 at 09:05:55AM -0400, shawn wilson wrote: > Nope, I knew how to correct it (as I showed in the last example), I > just figured the other two should work. "Work" how? You placed a variable in the TEMPORARY execution ENVIRONMENT of a command. You can tell it's an environment

Re: Array not defined when being set inline

2017-10-10 Thread Dan Douglas
On 10/10/2017 07:00 AM, shawn wilson wrote: > I guess that's the right way to describe what I'm seeing: > > [swilson@localhost ~]$ unset f; f=(aaa bbb ccc) declare -p f > declare -x f="(aaa bbb ccc)" > [swilson@localhost ~]$ unset f; f=("aaa" "bbb" "ccc") declare -p f > declare -x f="(aaa bbb

Re: Array not defined when being set inline

2017-10-10 Thread shawn wilson
On Tue, Oct 10, 2017 at 8:21 AM, Greg Wooledge wrote: > On Tue, Oct 10, 2017 at 08:00:58AM -0400, shawn wilson wrote: >> I guess that's the right way to describe what I'm seeing: >> >> [swilson@localhost ~]$ unset f; f=(aaa bbb ccc) declare -p f >> declare -x f="(aaa bbb

Array not defined when being set inline

2017-10-10 Thread shawn wilson
I guess that's the right way to describe what I'm seeing: [swilson@localhost ~]$ unset f; f=(aaa bbb ccc) declare -p f declare -x f="(aaa bbb ccc)" [swilson@localhost ~]$ unset f; f=("aaa" "bbb" "ccc") declare -p f declare -x f="(aaa bbb ccc)" [swilson@localhost ~]$ unset f; f=(aaa bbb ccc)