ksh(3) survival guide for bash(1) users

So you like bash, just like me. There are times though where you'd need to work on a machine where there is no bash, but ksh(3). Here is a list of commands and keys to help you:

Go back in history

Hit escape a few times, now hit "k" and "j" to move back and forward into the history.
Edit the command with the letters "h" and "l".

Complete commands

Type a part of your command, hit escape a few times, now hit "\" to complete the command.
You can't display what your options are, (in bash just tab a few times)

Get a decent prompt

Either run this command once, or add it to your ~/.profile:

export PS1="${USER}@$(hostname) ${PWD##*/} $ "

One major problem; the PWD variable does not change when changing directories!

Comments

When I read the code which

When I read the code which you have given in this post it is very easy and simple which made to do my work with very ease. From last few months I am searching for this code to implement in my essay help online blog. Linux being open source it has become little difficult for me to have codes for running my machine which has Linux operating system in it.

The idea behind this concept

The idea behind this concept is simple if many other websites link to your website then your website must be important In addition to the sheer number of the links, the quality of the links is also important. niche related manual backlinks

It does work. It's easy to

It does work. It's easy to follow and gives you good result. - Bath Planet

I just hope I can implement

I just hope I can implement the code to exacly.me company profile on LinkedIn

If you like the emacs-style

If you like the emacs-style commands embedded by default in bash, you can enter :

$ set -o emacs

The default ksh style uses a vi-like command set, this is why you need to switch between edition-mode and command-mode using the ESC key.
As a quick example, you can type ESC-dd (means press ESC, then press twice the d key) to delete the whole line, ESC-A to go to the end of the line in edition-mode, ESC-I to edit the beginning of a line, ESC-/keyword to search for keyword in history.
Those are actually vi(1) commands used to manipulate text.

To display a list of commands/filenames that match when completing, type ESC-=
To get every possible match separated by a SPACE, type ESC-*

Depending on your ksh version, prompts can be customised using backslash-escaped special characters.
The example that follows works well under OpenBSD's ksh(1):

$ export PS1='\n[\u@\h \W] % '

About Consultancy Articles Contact




References Red Hat Certified Architect By Robert de Bock Robert de Bock
Curriculum Vitae By Fred Clausen +31 6 14 39 58 72
By Nelson Manning [email protected]