Use zsh to emulate ksh

Jun 10, '03 09:58:00AM

Contributed by: wgscott

OS X comes with zsh but not ksh. zsh can be made to emulate ksh much like bash emulates sh. If you look in /bin, you will find tcsh and csh are hard linked to the same (tcsh) file, likewise bash and sh. To get zsh to deal with ksh shell scripts, you can issue:

  sudo ln /bin/zsh /bin/ksh
This must be a hard link to function correctly. The zsh page suggests a soft link, which on other UNIX systems seems to work, but Darwin apparently requires a hard link for it to function properly. Like bash, zsh "senses" how you invoke it (ksh vs. zsh; sh vs. bash) and sets defaults for the shell session accordingly.

You can also install ksh93 via fink unstable and then hard link it in the same way. Using zsh, however, is much more straightforward.

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030608023948686