From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22465 invoked by alias); 27 Feb 2016 13:48:02 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 38039 Received: (qmail 18897 invoked from network); 27 Feb 2016 13:47:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 Message-ID: <56D1A90B.9050006@inlv.org> Date: Sat, 27 Feb 2016 14:47:55 +0100 From: Martijn Dekker User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Zsh hackers list Subject: Re: [PATCH] make 'set +o' useful and POSIX compatible References: <56D113E0.4090609@inlv.org> In-Reply-To: <56D113E0.4090609@inlv.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Martijn Dekker schreef op 27-02-16 om 04:11: > That means it should be possible to do > > save_options=$(set +o) > > then change some options, then later restore the shell options with > > eval "$save_options" Hmm. There is still a problem with this. Two options are turned off in subshells, so the command substitution subshell $(set +o) will not store the output you want. $ set +o >1 $ (set +o) >2 $ diff 1 2 116c116 < set -o monitor --- > set +o monitor 177c177 < set -o zle --- > set +o zle This only seems to be relevant on interactive shells though, as 'monitor' and 'zle' are turned off in scripts. - M.