[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Command substitution and errexit
From: |
Greg Wooledge |
Subject: |
Re: Command substitution and errexit |
Date: |
Tue, 16 Oct 2012 08:16:39 -0400 |
User-agent: |
Mutt/1.4.2.3i |
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"
- Re: Command substitution and errexit, (continued)
Re: Command substitution and errexit, Nikolai Kondrashov, 2012/10/15
- Re: Command substitution and errexit, Greg Wooledge, 2012/10/15
- Re: Command substitution and errexit, Nikolai Kondrashov, 2012/10/15
- Re: Command substitution and errexit, DJ Mills, 2012/10/15
- Re: Command substitution and errexit, DJ Mills, 2012/10/15
- Re: Command substitution and errexit, Nikolai Kondrashov, 2012/10/16
Re: Command substitution and errexit, Nikolai Kondrashov, 2012/10/16
Re: Command substitution and errexit,
Greg Wooledge <=
Re: Command substitution and errexit, Nikolai Kondrashov, 2012/10/16
Re: Command substitution and errexit, Chet Ramey, 2012/10/15