4

Or are there any advantages of using zsh over ksh ?

Would any specific commands not execute successfully across the shells or are the major differences not command related, but something else?

Hritik
  • 133
1''
  • 357
  • 1
  • 4
  • 7

1 Answers1

8

There are ksh specific commands/options/shortcuts/features that won't work or work differently with zsh, and there are even more zsh specific things that would fail under ksh.

If your goal is to write scripts, my advice would be to stick to POSIX features shared by both shells. zsh might miss some POSIX ones as compliance is not in its design objectives.

If you are asking about what interactive shell to use and use the same machine 99% of the time, or if you use machine where you know your preferred shell is installed, the choice is really up to you and matter of personal opinion.

On the other hand, if you often switch from machine to machine, the main risk is the frustration of not finding the expected shell to be installed and miss some features you are used to with what you are left to work with.

As neither ksh nor zsh is guaranteed to be installed regardless of the Unix and Linux distribution, there is no definitive answer. ksh tend to be the default or at least the standard compliant shell on many Unix like Solaris, AIX, HP-UX while zsh is often only an optional shell that needs to be installed separately.

Note too that there are various ksh implementations with different sets of features (or lack of), including pdksh, ksh88 and ksh93 so you might have a similar frustrating experience if you switch from one implementation to another, or to an older version from a newer.

jlliagre
  • 61,204