From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2176 invoked by alias); 18 Sep 2010 03:25:21 -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: 28270 Received: (qmail 26492 invoked from network); 18 Sep 2010 03:25:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <100917202510.ZM32292@torch.brasslantern.com> Date: Fri, 17 Sep 2010 20:25:10 -0700 In-reply-to: <4C93A654.90807@redhat.com> Comments: In reply to Eric Blake "avoid $status and $options in POSIX mode" (Sep 17, 11:33am) References: <4C93A654.90807@redhat.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Eric Blake , zsh-workers@zsh.org Subject: Re: avoid $status and $options in POSIX mode MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 17, 11:33am, Eric Blake wrote: } Subject: avoid $status and $options in POSIX mode } } Yet, the existence of zsh-magic variables like $status and $options } infringe upon the right of a user's script to use this namespace for } their own desires. For example, see this recent autoconf patch: } http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=23a2c336 That patch is incorrect (or maybe only partly correct). The "options" variable is only defined if the zsh/parameter module has been loaded, which it won't be when the shell is started as "sh". The "status" variable is also disabled when the shell is started as "sh". If autoconf is running into problems with $options, the maintainers need to find out why zsh/parameter is being loaded in the first place. Is the shell run by the name "zsh" and *then* switched to emulation? In that event, module autoloads will still be in effect, so $options will load itself. The zsh manual says: In `sh' and `ksh' compatibility modes the following parameters are not special and not initialized by the shell: ARGC, argv, cdpath, fignore, fpath, HISTCHARS, mailpath, MANPATH, manpath, path, prompt, PROMPT, PROMPT2, PROMPT3, PROMPT4, psvar, status, watch. } It would be really nice if 'emulate sh' could disable zsh magic handling } of any variables that infringe upon the lower-case namespace reserved } for applications. Starting the shell as zsh and then running "emulate" is not the same as compatibility mode, and is unlikely ever to be; "emulate" is meant to switch back and forth with minimal loss of state, not to entirely wipe the slate and become another shell.