From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21719 invoked by alias); 30 Jan 2012 21:19:25 -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: 30160 Received: (qmail 20266 invoked from network); 30 Jan 2012 21:19:22 -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,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: Felipe Contreras Cc: zsh-workers@zsh.org Subject: Re: Bug with sh emulation; shouldn't KSH_TYPESET be set? In-Reply-To: (Felipe Contreras's message of "Mon, 30 Jan 2012 22:21:52 +0200") References: User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) Date: Mon, 30 Jan 2012 21:43:49 +0100 Message-ID: <878vkoapkq.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain X-Df-Sender: [pbs]MzQ5NTM4 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. FWIW, dash and posh behave like zsh's sh-mode here. Ksh93 doesn't work at all, because it has no `local' (only typeset). Mksh, pdksh and bash work like KSH_TYPESET was set in zsh. Regards, Frank