Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: help adapting bashism for zsh
- X-seq: zsh-users 23971
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx>
- Subject: Re: help adapting bashism for zsh
- Date: Mon, 10 Jun 2019 13:22:44 -0700
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ql1IBYTkQNZ+4NzmUVmat3ePioiGSTtUWfYPGKht21E=; b=W86VhSa6h6HG+ReQmqv9j16c/ptt0KzJEtyPM1zJ3HEipjsjzC9pV/+4LEtTI5093r smG74a8OA4IYotXHMvE/+9dv/US1ES2k6Od3bwFkqHEvz/BM6fI/F+wuoN+viDdzmz90 7EfCQOVehdoKPjobAcP0uRUCf3bYz4pHqGZvUVsxRh9MBsM+l1Dc56CZouJhcWIf7Y7d MIuZWUH4KOnkpIa8DW/SaEMYHHOPCN2TJM08RRL7UDPjUGbNkIFuJkND9Fu1krqXTZaS lH+98e9UaK3Y8KJ28i3flqB8eSUdbkavNCu0N1j5ib6nN3wUIjgJ3IEcNQp3alNQ/iXF UzpA==
- In-reply-to: <dc644109-52d9-38e3-277d-ed12a218e0ac@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>
On Sun, Jun 9, 2019 at 5:34 PM David C. Rankin
<drankinatty@xxxxxxxxxxxxxxxxxx> wrote:
>
> Is there any collection of aliases, tweaks, brute-force sed scripts, etc..
> that I could look at an pull parts from to handle most of the issues?
First thing -- how are these scripts executed? E.g., are they run as
standalone processes via interpreter named in a "#!" line at the top,
or are they somehow pulled into an interactive shell, or something
else?
If using the "#!" interpreter, the first thing to try is simply to
symlink that name to your zsh binary. When invoked as (a path ending
in) "bash" or "sh" (or "ksh"), zsh enters a compatibility mode that
will resolve the most common issues. You can then work on specific
problems with any scripts that are still failing.
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author