Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
help adapting bashism for zsh
- X-seq: zsh-users 23966
- From: "David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: help adapting bashism for zsh
- Date: Sun, 9 Jun 2019 19:33:09 -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>
- 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
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author