Miscellaneous Commands

The following sections contain Korn shell equivalents of some miscellaneous C shell commands and functions.

The .logout File

In the C shell, commands in the ∼/.logout file are executed on exit. If the following command is added to the ∼/.profile file, then the same thing will happen in the Korn shell:

						trap '. ∼/.logout' EXIT
					

The chdir Command

The C shell chdir command changes to the specified directory and can be set to a Korn shell alias like this:

						alias chdir='cd'
					

The logout Command

The C shell logout command is equivalent to the exit command. It can be set to a Korn shell alias:

						alias logout='exit 0'
					

The setenv Command

The C shell setenv command is used to set/display variables and can be invoked like this: ...

Get Korn Shell: Unix and Linux Programming Manual, Third Edition, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.