Using Korn Shell

History

      Using the shell history is useful if you don't want to retype commands that you have already typed. In ksh, once you have set up the history in your .profile, just hit the escape key and then use keys corresponding to vi commands to get back to the command that you want to execute.

The keys that you would use are:

k = go up
j = go down
l = go right
h = go left
i = insert
a = append

For example, let's say that you have typed three commands so far:

unixprompt >ls -al
unixprompt >wcwho -re someuser
unixprompt >blahblahblah

      Now let's say that you want to use the command wcwho -re someuser, but don't want to have to retype all of that again. You would use these steps to execute the command:

  • hit the escape key
  • use the letter k to scroll up until you see the command that you want to     execute
  • hit enter to execute the command.
  •       For a more advanced example, let's say that you wanted to type wcwho -re someotheruser, but didn't want to have to type the wcwho -re part again. You would use these steps to execute and edit the command from your history:

  • hit the escape key
  • use the letter k to scroll up until you see the command that you want to     execute
  • use the l key to move to the right until you get to the part that you      want to delete and replace with something else
  • hit the right arrow key and then insert your additional text
  •       As you use ksh, you will learn more and more tricks and all of this will seem easy to you even though it may be difficult at first. To help you in your study of ksh, refer to the manual entry for ksh. The command that you would type to access the page (from an hp) is:

    unixprompt >man ksh

    Exporting
    Your
    Display

          Unlike csh and tcsh, which use the command "setenv", ksh uses the command "export" to export display windows from other workstations. However, if you are using an EWS workstation, you simply need to type:

    ssh remote_machine_name

          Then type your password. ssh figures out the rest for you and exports your display (encrypted) to whatever workstation you are working at.

    Other
    Features
    of ksh

          Most of the widely used features of ksh including customizing your prompt are implemented in the .profile. Please see the page on using a .profile for more information.



    For further information on UNIX Shells one can look at:
    • Zsh- EWS Online Manual Page for Zsh
    • Tcsh - EWS Online Manual Page for Tcsh
    • Csh - EWS Online Manual Page for Csh
    • Changing your Shell - EWS Online Manual Page for Changing your Shell
    Back to the table of contents