Re: TIMEFORMAT in time ( )

2016-10-19 Thread Chet Ramey
On 10/16/16 6:01 PM, isabella parakiss wrote: > $ cat myscript > TIMEFORMAT=foo var=x > > time ( TIMEFORMAT=bar var=y ) > echo "<$TIMEFORMAT> <$var>" > > f() { TIMEFORMAT=f; time :; } > time ( f ) > echo "<$TIMEFORMAT>" > > > $ bash myscript > bar > > f > f > > > > > setting TIMEFORMAT in

Re: TIMEFORMAT in time ( )

2016-10-17 Thread Eduardo A . Bustamante López
The attached patch "fixes" this: hp% ./bash -c 'time (TIMEFORMAT=y)' real0m0.001s user0m0.000s sys 0m0.000s hp% bash -c 'time (TIMEFORMAT=y)' y Disclaimer: I don't know if it's a good patch. It may break stuff. This problem is caused due to bash passing

Re: TIMEFORMAT in time ( )

2016-10-16 Thread lolilolicon
On Mon, Oct 17, 2016 at 6:01 AM, isabella parakiss wrote: > > f() { TIMEFORMAT=f; time :; } > time ( f ) > f > f > > setting TIMEFORMAT in ( ) affects time out of the subshell > this cannot be right time is a reserved word, not a builtin. time is not "out of the subshell". Its env is that of the