bug-bash
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]