From: Greg Wooledge
Subject: Re: `times` of the Parent Shell
Date: Sat, 1 Nov 2025 10:28:10 -0400
>I suppose there might be some alternative way to do it with the new
>non-forking command substitutions in bash 5.3, but I haven't played
>with those yet, and bash 5.3 is not widely installed at this point.
Yes. This works in 5.3:
$ foo=$(times)
# This prints (almost) all zeroes - as expected, since it runs 'times' in
# a subshell.
$ echo "$foo"
$ foo=${ times; }
# But this prints the right thing!
$ echo "$foo"
Seems reasonable to me. Don't we always assume that participants in
these forums are always running the latest version of the things we
discuss?