From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26250 invoked from network); 30 Apr 2007 02:49:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.8 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Apr 2007 02:49:06 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 22566 invoked from network); 30 Apr 2007 02:49:00 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Apr 2007 02:49:00 -0000 Received: (qmail 12346 invoked by alias); 30 Apr 2007 02:48:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23353 Received: (qmail 12336 invoked from network); 30 Apr 2007 02:48:57 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 30 Apr 2007 02:48:57 -0000 Received: (qmail 22262 invoked from network); 30 Apr 2007 02:48:57 -0000 Received: from redoubt.spodhuis.org (HELO mx.spodhuis.org) (193.202.115.177) by a.mx.sunsite.dk with SMTP; 30 Apr 2007 02:48:54 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=first1; d=spodhuis.org; h=Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=N7wvGFXdDcdMer69/GFjccF0sdJYPgd/4Sp1fG6vqZfXzrkPOOzt40wQpt77iYJ82VMyeP7hXhtJoAXgxAJd94HJvMBAwxqFvTax7GnwONmRumtAexXD/7ETXGH8L2lxyJKxk51VAanz/SMGgkTTkmtFYgiFn2p6fmpKBFuDj6E=; Received: by smtp.spodhuis.org with local id 1HiLwc-000Hur-0a; Mon, 30 Apr 2007 02:48:54 +0000 Date: Sun, 29 Apr 2007 19:48:53 -0700 From: Phil Pennock To: zsh-workers@sunsite.dk Subject: Re: exec -l Message-ID: <20070430024853.GB65832@redoubt.spodhuis.org> Mail-Followup-To: zsh-workers@sunsite.dk References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On 2007-04-29 at 17:52 -0700, Dave Yost wrote: > Why does zsh not have "exec -l" a la bash? Because zsh had already introduced its own non-standard way to do the same thing before bash added its own non-standard extension? And nobody's pushed to copy bash's behaviour? And ksh has yet another way. So there's no portable method and nobody's yet contributed code to zsh to copy the interface provided by other shells. The Single Unix Specification v3 doesn't include any flags for exec. (Look in the XCU section). Zsh does not provide any flags. In zsh, you can put a "-" at the start of any external command by using the "-" builtin command. It's the first builtin listed in zshbuiltins.1. So, you'd do: exec - cmd so that you exec cmd with argv[0] being "-cmd". Or just "- cmd" to run it as a child process. Alternatively, zsh lets you specify _any_ string as argv[0] for a new command by ensuring that the variable ARGV0 is set in the environment when you run it. So, for instance, you can do: ARGV0=-sh exec zsh to exec zsh with argv[0] set to "-sh", such that zsh will emulate a POSIX "sh" more closely and do so as a login shell. This is what in ksh would be "exec -a -sh zsh". -Phil