zsh-users
 help / color / mirror / code / Atom feed
* help adapting bashism for zsh
@ 2019-06-10  0:33 David C. Rankin
  2019-06-10  5:41 ` Roman Perepelitsa
  2019-06-10 20:22 ` Bart Schaefer
  0 siblings, 2 replies; 9+ messages in thread
From: David C. Rankin @ 2019-06-10  0:33 UTC (permalink / raw)
  To: zsh-users

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-06-11  8:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-10  0:33 help adapting bashism for zsh David C. Rankin
2019-06-10  5:41 ` Roman Perepelitsa
2019-06-10 14:43   ` David C. Rankin
2019-06-10 14:53     ` Roman Perepelitsa
2019-06-10 17:34       ` Ray Andrews
2019-06-10 21:55         ` David C. Rankin
2019-06-10 20:22 ` Bart Schaefer
2019-06-10 22:31   ` David C. Rankin
2019-06-11  8:56     ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).