From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22444 invoked by alias); 30 Jan 2012 22:20:52 -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: 30164 Received: (qmail 11586 invoked from network); 30 Jan 2012 22:20:49 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Mon, 30 Jan 2012 23:20:44 +0100 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: Bug with sh emulation; shouldn't KSH_TYPESET be set? Message-ID: <20120130222044.GK3663@xvii.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org References: <878vkoapkq.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.21-6201-vl-r48020 (2011-12-20) On 2012-01-30 23:46:46 +0200, Felipe Contreras wrote: > On Mon, Jan 30, 2012 at 10:43 PM, Frank Terbeck wrote: > > Felipe Contreras wrote: > > [...] > >>       local t=$(echo foo --bar) > > [...] > >> But not in zsh, with sh emulation. Enabling KSH_TYPESET makes it work. > >> > >> Shouldn't it be enabled with sh emulation? > >> > >> BTW. What exactly is 'emulate sh' supposed to emulate? I would like to > >> run that shell to check for compatibility issues, and apparently it's > >> not bash. > > > > "emulate sh" is POSIX shell emulation (we did amend this mode in the > > past to work as much as possible as POSIX describes). Neither typeset > > nor local are part of POSIX (at least not SUSv3 - I don't know about > > v4). > > > > So, I don't think it should be enabled. > > But it wouldn't hurt either, right? Not sure. What if you have some executable named "local" in the path? > It would be nice to have some 'bash' emulation mode, but since there > isn't any, why not enable this harmless option? Instead of changing options for sh emulation, why not add a 'bash' emulation mode, even though it may not be perfect (it would be better than sh anyway). -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)