Korn Shell Tips

Most of us are used to using bash and the Linux terminal settings for things like auto-complete, history and special keys. Unfortunately, they don’t work out-of-the-box on the most other UNIX systems and in Korn shell in particular. Here are few things which may help you:

1. Making backspace work: set your client (e.g., PuTTY, Gnome terminal etc.) to send <CTRL+H> when ‘Backspace’ is pressed. This will still work on Linux and but will make the ‘Backspace’ key work on other systems too.

2. History and auto-complete. First, check Korn shell version:

  • Type set -o emacs, press <Enter> (i.e. set your shell to follow emacs key bindings)
  • Type <CTRL+V>
  • Check whether the remote system is version 88 or 93.

For Korn shell version 88 (oldest and most unfriendly one):

  • Type set -o vi, press <Enter> (i.e. set your shell to follow vi key bindings)
  • Use <ESC>- for history (press and release ESC, then press minus key)
  • Use <ESC>\ for auto-complete (press and release ESC, then press backslash). If more than one option is available, auto-compete will only show the common part of them.
  • Use <ESC><SHIFT+8> for all auto-complete options (press and release ESC, then press SHIFT and ‘8’ key together).

For version 93:

  • Use set -o emacs to make your arrow keys scroll through history
  • Use bind “^I=complete” to get the TAB key work as auto-complete.

If these don’t work on your 93 version, you can still revert to version 88 shortcuts.

This entry was posted in Нули и единици. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.