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=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 8402959f for ; Mon, 10 Jun 2019 00:33:55 +0000 (UTC) Received: (qmail 6700 invoked by alias); 10 Jun 2019 00:33:43 -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: 23966 Received: (qmail 27230 invoked by uid 1010); 10 Jun 2019 00:33:43 -0000 X-Qmail-Scanner-Diagnostics: from omta04.suddenlink.net 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(208.180.40.74):SA:0(-2.6/5.0):. Processed in 0.790369 secs); 10 Jun 2019 00:33:43 -0000 X-Envelope-From: drankinatty@suddenlinkmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at suddenlink.net designates 208.180.40.74 as permitted sender) To: zsh-users@zsh.org From: "David C. Rankin" Subject: help adapting bashism for zsh Openpgp: preference=signencrypt Autocrypt: addr=drankinatty@suddenlinkmail.com; prefer-encrypt=mutual; keydata= xsBNBFkinL8BCADU5H9ZxEu+IIMb75pSmVXhW7ujTM7p2TzjZiyTT3Lfbxuoso1rWyAaAti6 Jyfw2pk0SJYw+8afn1+Ag/BtmSGm7wiuGdpHlDL0e/2sbyCYoFExpFLecgd5+mU+M6GCNUaM vZ79BaM2wn+c4r1r0LcPmy7uweHhaVXGlocfMChd2fBweonL2jd4bX64XZbB5YErpkzxFN69 kM+I4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EaJyRJ MG0RyQVv1wIPCIcFAlkinL8CGwwACgkQyQVv1wIPCIffjwf/YXoinAWabuqugYxSNafvBcXA GEE5arTYSGSXhUWBER1Oz0U5BjeWAKKtan88pHkFrdHYW8su5A6Dn7jDxUWAVjXzRvA0LNbJ fKOrBw7knGJSqYQD7gdeBJZOSLf0Mt9g9evkxhR4cLFHG0mWH07H1yIreLNFTs+i0B3tKY44 P5bsNcAzMwD2G1rJehiFTbxRlAiCc6v61rzu80XaDKLEJFHVYhCJRXrla04DoGZdZKfc6urF g/aUn+7z1pO70uumOnKvLViitsJ6IsxAsfhZp4KPBbbkTjixcTPfJAQGzQhcoZS22jGTPg1N 7G4xtqMT/M34TbodTbaIO0HkA4n1Hw== Organization: Rankin Law Firm, PLLC Message-ID: Date: Sun, 9 Jun 2019 19:33:09 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at dalofep04.suddenlink.net from [66.76.46.195] using ID drankinatty@suddenlinkmail.com at Sun, 9 Jun 2019 19:33:09 -0500 X-CM-Analysis: v=2.3 cv=PfaBeRpd c=1 sm=1 tr=0 cx=a_idp_d a=/cos1G3ae6AqFCvJLv+j9g==:117 a=/cos1G3ae6AqFCvJLv+j9g==:17 a=IkcTkHD0fZMA:10 a=dq6fvYVFJ5YA:10 a=FP58Ms26AAAA:8 a=MQVa-A2i7cuXIrkq-mcA:9 a=QEXdDO2ut3YA:10 a=wXK-LX6JIFwA:10 X-CM-Envelope: MS4wfCn6aCyQbN632D82DqyuoPUOiZTsoNtett0EoRz88AmeFHxeaRGQPtWCBbq6uOG4U5kc8uy15Y2ZTrAAJdco5+IgAF3VLpmEu9rpapun/zCMHPlkS6aT UIeCIZEszKRG5oCYuWFqbFr+GFl80hXwufvCDqnLl/K2dNr7a+0aMIxd/kPG3S5YDr144IVEMnuMeA== All, There is a lot I like about zsh, but almost an equal amount I don't. The problem is how to handle adapting the 2566 POSIX and bash scripts I have to be zsh compatible. The biggest issues are parameter-expansions, 1's indexing, and issues with 'type' and other builtins being just enough different that my existing scripts break when using zsh as the interpreter. 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? For example with 'type', I can alias it to 'whence', but the documentation for it is of little help with the expected behavior for type itself, e.g. type [ -wfpamsS ] name ... Equivalent to whence -v. at http://zsh.sourceforge.net/Doc/Release/Shell-Builtin-Commands.html, but the options [ -wfpamsS ] largely have no effect on how type behaves. Then what to do with a large portions of the scripts that rely heavily on string indexing and C-style for loops? The KSH_ARRAYS options is a temporary bandaid for C-style loops, but that injects zsh incompatibility and the documentation is absent on its effect on string indexing (e.g. ${foo:offset:length}). Then what to do about the non-existing expansions such as ${foo^^} (uppercase) and ${foo,,} (lowercase), etc.. In looking for solutions, I want to stay with core zsh solution, instead of plugins, modules, etc... Is there some collection of information that helps with this transition process, or is it largely a script-by-script rewrite to make the scripts compatible? -- David C. Rankin, J.D.,P.E.