From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id a3b62bf2 for ; Mon, 10 Jun 2019 20:23:42 +0000 (UTC) Received: (qmail 27975 invoked by alias); 10 Jun 2019 20:23:33 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23971 Received: (qmail 10370 invoked by uid 1010); 10 Jun 2019 20:23:33 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf1-f52.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25475. spamassassin: 3.4.2. Clear:RC:0(209.85.167.52):SA:0(-1.9/5.0):. Processed in 1.787021 secs); 10 Jun 2019 20:23:33 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.167.52 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ql1IBYTkQNZ+4NzmUVmat3ePioiGSTtUWfYPGKht21E=; b=LgOqwRFZnnW8jUUh4JCrVAI0i1AAPsMpyxk9apffTa3J7EN4woFzet/mRh3/bshZgI KPlrr/TQXnGv7EfSEx8rClV4N8wJI7xW2rcS/NIoGG6qyP41XgzQ5c6k3LJSb5YLm9+P brJmn65aXhu7NIp8qTLAiYeNLnyOXfqQQBMd+A+pBFd5ymiS97Tnmq28ZZnNDdhkJlGt OCW86CEFUYkJCVXc0vhFHuWAXOx7G6/NhERSbBBc/HpnOgHTOAXATJsyqBqEtyLhPmUL eV5vW92vHABjozQaoxHYyNoiXCTiHp867wEpMPJynsx+eNhWb/Jya3meIiy+QsKGroQH cAow== X-Gm-Message-State: APjAAAUuOQz8cyy6iNMHrUkqAtIPGFuOcsHX+HctbV8RHR2hC08zLvj2 bIiuCIA6kGSn6Eu4MfxkYRzL3g6gV9treZ8q0VOqGOmzSpuPcw== X-Google-Smtp-Source: APXvYqxDtI+xlPLoUIUmPCI+6BJrsWSSN3fLwG4k1K7VpYtvR9OW5N43/KYqEtP6T7NoTvJg4PHQ4cQuiFGj74ujKUU= X-Received: by 2002:ac2:5310:: with SMTP id c16mr35179398lfh.119.1560198176132; Mon, 10 Jun 2019 13:22:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Mon, 10 Jun 2019 13:22:44 -0700 Message-ID: Subject: Re: help adapting bashism for zsh To: "David C. Rankin" Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" On Sun, Jun 9, 2019 at 5:34 PM David C. Rankin 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.