On 10/16/2012 03:16 PM, Greg Wooledge wrote:
On Mon, Oct 15, 2012 at 08:08:10PM -0400, DJ Mills wrote:
done< <(set -o)
Huh... that's interesting. I wouldn't have expected it, but it turns
out you don't "lose" the value of errexit in a process substitution the
way you do in a command substitution.
imadev:~$ bash -c 'set -e; x=$(set +o); grep errexit<<<"$x"'
set +o errexit
imadev:~$ bash -c 'set -e; grep errexit<(set +o)'
set -o errexit
So, assuming Nikolai still wants to go with his current design, I guess
he could use code like this:
read -rd '' settings< <(set +o)
...
eval "$settings"
That would do nicely, thanks Greg!
However, is this as supposed to be? Because, if it's not, or there is no
certainty, I'd rather not use it.
Thanks.
Sincerely,
Nick