Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: help adapting bashism for zsh
- X-seq: zsh-users 23973
- From: "David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx>
- To: zsh users list <zsh-users@xxxxxxx>
- Subject: Re: help adapting bashism for zsh
- Date: Mon, 10 Jun 2019 17:31:13 -0500
- Autocrypt: addr=drankinatty@xxxxxxxxxxxxxxxxxx; prefer-encrypt=mutual; keydata= xsBNBFkinL8BCADU5H9ZxEu+IIMb75pSmVXhW7ujTM7p2TzjZiyTT3Lfbxuoso1rWyAaAti6 Jyfw2pk0SJYw+8afn1+Ag/BtmSGm7wiuGdpHlDL0e/2sbyCYoFExpFLecgd5+mU+M6GCNUaM vZ79BaM2wn+c4r1r0LcPmy7uweHhaVXGlocfMChd2fBweonL2jd4bX64XZbB5YErpkzxFN69 kM+I4CmkzOaSSLfN6//EUgc2zBKGVJhM6fpZjVE4Wm8S+khvrJwFG0ZoaPC1Ol/b47iyqZcf jFZs75i2Tjd3AYyQ6Ai3ZNGrwv2PJSAawR+hfZLeNf5aMaIqoG099SsAN3j8wW97DDjbABEB AAHNRERhdmlkIEMuIFJhbmtpbiwgSi5ELixQLkUuICh3aXphcmQpIDxkcmFua2luYXR0eUBz dWRkZW5saW5rbWFpbC5jb20+wsCOBBMBCAA4FiEEUoo6wDEaJyRJMG0RyQVv1wIPCIcFAlki nL8CGwMFCwkIBwIGFQgJCgsCBBYCAwECHgECF4AACgkQyQVv1wIPCId/wgf/b+9BBzhRr2i+ LDa5qHwlxmRbvQZp9yYzFbJV6s4Djyukir7CGYrzAvuFUWBIFiExBspGdHuQ3b/UA66/uupf 6DlzRRTs62WMjK9DTZbQfFxqnx+EWCDKbBlXMsaIu/FjtBtc13uOzza967OdE8l2uxUH7+B4 /S8ReppJ+FXm2pzo4qlq1YYNtX0cd7BymZdn0G2ogeHos2Ay5bYOfiYWFVwb7fnZ54DCsOfb H0M9RUIhA5ZKeChsCOAZvtiMMemIr/xihE8Ds7INbtEXxm00o4xgRiWSSJeuoOfeSilHbVjJ Ry26E/KhKvkZbcnGCJsQRo8DPq5P/O5UQn0HVvGyTs7ATQRZIpy/AQgAwX/4Z6vfnfWsr8WA qV6WYKK8FtIrWXBjEeztxiCAJydMwZkPQRbOJlZElLpZvWLHFp68mbMfrcv23dMJCH+jE5XB La/p7XZp10IHzBhedZbI2MBBsnfrqqCdrf0KNPfS9bD6+37ued+O8ONm4ELhzHfjlGojNddB vMEu7EQKY19u/X2sINiYvrAOX6ss21E4r4AoVojQqaL7fmrRCD2uI76z7O9zC3mQ0/JpkuEo 0Yi97H+P3d3qSDb0IovPPyfioMAy7KIGSAYCHzxd47zvkYWlfSEWQ1aenAAvGgqKrZ3/KP9a V1ekGimYYIpnT/JJ67DPDx9gKlQD9f1YZVcQvwARAQABwsB2BBgBCAAgFiEEUoo6wDEaJyRJ MG0RyQVv1wIPCIcFAlkinL8CGwwACgkQyQVv1wIPCIffjwf/YXoinAWabuqugYxSNafvBcXA GEE5arTYSGSXhUWBER1Oz0U5BjeWAKKtan88pHkFrdHYW8su5A6Dn7jDxUWAVjXzRvA0LNbJ fKOrBw7knGJSqYQD7gdeBJZOSLf0Mt9g9evkxhR4cLFHG0mWH07H1yIreLNFTs+i0B3tKY44 P5bsNcAzMwD2G1rJehiFTbxRlAiCc6v61rzu80XaDKLEJFHVYhCJRXrla04DoGZdZKfc6urF g/aUn+7z1pO70uumOnKvLViitsJ6IsxAsfhZp4KPBbbkTjixcTPfJAQGzQhcoZS22jGTPg1N 7G4xtqMT/M34TbodTbaIO0HkA4n1Hw==
- Disposition-notification-to: "David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx>
- In-reply-to: <CAH+w=7YdaTdCgG-fGycQTdFHobwSNUDQWZ3v=9gQa_B26y2bHQ@mail.gmail.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
- Openpgp: preference=signencrypt
- Organization: Rankin Law Firm, PLLC
- References: <dc644109-52d9-38e3-277d-ed12a218e0ac@suddenlinkmail.com> <CAH+w=7YdaTdCgG-fGycQTdFHobwSNUDQWZ3v=9gQa_B26y2bHQ@mail.gmail.com>
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.
--
David C. Rankin, J.D.,P.E.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author