Process Substitution subshell inherits the desire to print its times if it contains explicit exit

2018-04-04 Thread Basin Ilya
Hi. In an attempt to capture the output of 'time' I used the process substitution and noticed that the subshell also prints its times. Actually I this happens when I redirect any fd, not just stderr. #!/bin/bash time { sleep 0.25 exec 6> >( sed 's/^/captured: /'

Re: $PS5, for sh -v!

2018-04-04 Thread Greg Wooledge
On Wed, Apr 04, 2018 at 11:25:26AM +0800, 積丹尼 Dan Jacobson wrote: > $PS4 is for sh -x. Well, $PS5 or $PSv should be for sh -v! > > Imagine, with just a simple PS5='$ ', one could produce > perfect dialogues, > > $ set -eu /tmp/x > $ mkdir $@ > $ cd $@ > $ seq 3|xargs touch > $ ls -U $@ > 3 2 1

Re: Process Substitution subshell inherits the desire to print its times if it contains explicit exit

2018-04-04 Thread Greg Wooledge
On Wed, Apr 04, 2018 at 11:21:56AM +0300, Basin Ilya wrote: > Hi. > > In an attempt to capture the output of 'time' https://mywiki.wooledge.org/BashFAQ/032

Re: Error message garbage when parameter expansion used inside (()) and variable unset

2018-04-04 Thread Chet Ramey
On 4/3/18 7:07 PM, PRussell wrote: > Hi, > > The error seems to be localized to the expansion of PS4 when "set -x" is > active. > > Please see sample script below. > > I am aware of the unusual parameter expansion for FUNCNAME. There might be a > local historical reason. :-) > > It does not

Re: Error message garbage when parameter expansion used inside (()) and variable unset

2018-04-04 Thread Chet Ramey
On 4/3/18 7:07 PM, PRussell wrote: > Hi, > > The error seems to be localized to the expansion of PS4 when "set -x" is > active. > > Please see sample script below. It's not quite that, though the expansion below does demonstrate what I think is the problem. If I am right about the cause, the p

Re: Process Substitution subshell inherits the desire to print its times if it contains explicit exit

2018-04-04 Thread Chet Ramey
On 4/4/18 4:21 AM, Basin Ilya wrote: > Hi. > > In an attempt to capture the output of 'time' I used the process substitution > and noticed that the subshell also prints its times. Actually I this happens > when I redirect any fd, not just stderr. It's an interaction between command timing and t