help / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-users@zsh.org>
Subject: Re: help adapting bashism for zsh
Date: Tue, 11 Jun 2019 09:56:44 +0100
Message-ID: <1560243404.7122.4.camel@samsung.com> (raw)
In-Reply-To: <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


      reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10  0:33 David C. Rankin
2019-06-10  5:41 ` Roman Perepelitsa
2019-06-10 14:43   ` David C. Rankin
2019-06-10 14:53     ` Roman Perepelitsa
2019-06-10 17:34       ` Ray Andrews
2019-06-10 21:55         ` David C. Rankin
2019-06-10 20:22 ` Bart Schaefer
2019-06-10 22:31   ` David C. Rankin
2019-06-11  8:56     ` Peter Stephenson [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1560243404.7122.4.camel@samsung.com \
    --to=p.stephenson@samsung.com \
    --cc=zsh-users@zsh.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link


Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-users

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/ public-inbox