Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: help adapting bashism for zsh
- X-seq: zsh-users 23974
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-users@xxxxxxx>
- Subject: Re: help adapting bashism for zsh
- Date: Tue, 11 Jun 2019 09:56:44 +0100
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190611085646euoutp0156fb462d537a50d1c7fa7ee8498fb44a~nGRytbBd11620216202euoutp01y
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1560243406; bh=uW2gaGeS2T62SG2g2c/Ka83hmHtEFEaKRl8T6cpThkQ=; h=Subject:From:To:Date:In-Reply-To:References:From; b=exYZSf/yNeMuJ3BHyY1CXOCW17VX9BnVb74XbLMiMGKqsAxRiISPCTgwGQEwH/f6v V1o+/CPzBn+Tr0QEarYU3MZKiUuwB/yR9BoRH54rkweaxxyAbOBdhDt9T2HXCcIClB FTLgm0UeSJthMiOos2uhx/t06eT6sCEuXirCk+WU=
- In-reply-to: <c0918f9a-d5b6-a44b-f3da-2065da6fb9ca@suddenlinkmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <dc644109-52d9-38e3-277d-ed12a218e0ac@suddenlinkmail.com> <CAH+w=7YdaTdCgG-fGycQTdFHobwSNUDQWZ3v=9gQa_B26y2bHQ@mail.gmail.com> <CGME20190610223222epcas1p3235b6daa01015b5010bf491a3a80a876@epcas1p3.samsung.com> <c0918f9a-d5b6-a44b-f3da-2065da6fb9ca@suddenlinkmail.com>
On Mon, 2019-06-10 at 17:31 -0500, David C. Rankin wrote:
> On 06/10/2019 03:22 PM, Bart Schaefer wrote:
> > This compatibility mode differs from setting individual options such
> > as KSH_ARRAYS, but can be fairly closely duplicated by using the
> > "emulate" command. If the scripts are intended to become the bodies
> > of shell functions, try adding "emulate -L sh" at the top.
>
> > > Then what to do about the non-existing expansions such
> > > as ${foo^^} (uppercase) and ${foo,,} (lowercase), etc..
> > These are handled with (in those specific examples) ${foo:u} and
> > ${foo:l}. In fact ^^ has a completely different meaning in zsh, so
> > you will have to do a search-and-replace for those kinds of
> > nonstandard tricks.
> Thank you Bart,
>
> That seems like the logical path forward. I was sure hoping somebody already
> had a handy-dandy parse & convert routine, but it looks like a normal convert
> as you go. As I go through them I'll try and keep a list of the most common
> bash/zsh conversions and notes of those cases where there is no 1-for-1
> replacement. It will be an as-time-permits endeavour, but maybe we can catch
> most issues.
The FAQ, section 2.1, should help, from the Etc directory of the
distribution or http://zsh.sourceforge.net/FAQ/zshfaq02.html#l10
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author