On Tue, Oct 16, 2012 at 12:01:56AM +0300, Nikolai Kondrashov wrote: > 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.
Sidestepping the direct question for a moment, you could use a temporary file instead of a command substitution to store the output. Then there would be no subshell involved.