[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Command substitution and errexit
From: |
Nikolai Kondrashov |
Subject: |
Re: Command substitution and errexit |
Date: |
Tue, 16 Oct 2012 00:01:56 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.7) Gecko/20120922 Icedove/10.0.7 |
On 10/15/2012 11:00 PM, DJ Mills wrote:
I'm also not entirely sure what you mean by "errexit will always be
stored as off."
I mean that if I try to capture option state with, for example: opts=`set +o`,
the errexit status will be lost.
It's on there... Do you not understand that command substitution
creates a subshell?
I understand that command substitution is a subshell, however it acts
differently from, say, ( ) subshell in this regard.
What is the goal/problem that you're trying to solve?
I'm trying to implement a pair of functions that would save/restore option
state onto/from a stack, so I could modify options temporarily for some parts
of code. I've worked around this problem already and it is not the subject
of the original message. I just wanted to know if errexit being forced off in
a command substitution was inteded or if it was a bug and needed fixing.
Thank you.
Sincerely,
Nick
- Command substitution and errexit, Nikolai Kondrashov, 2012/10/15
- Re: Command substitution and errexit,
Nikolai Kondrashov <=
- 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, 2012/10/16
- Re: Command substitution and errexit, Nikolai Kondrashov, 2012/10/16
Re: Command substitution and errexit, Chet Ramey, 2012/10/15