up previous next contents
Next: Your Login Files Up: The Korn Shell Previous: The whence Command   Contents

The set command

set

Typed in by itself, the set command displays all of the variables known to the current shell. This is shown below:

$ set 

DESKTOPDIR=/home/aja1
DISPLAY=UNIX:0.0
DT=yes
FCEDIT=/bin/ed
HOME=/home/aja1
IFS=  
KEYB=us
LANG=C
LC\_CTYPE=C
LC\_MESSAGES=C
LOGNAME=aja1
MAIL=/var/mail/aja1
MAILCHECK=600
OLDPWD=/home/aja1/netware/mcs01.nws/sys.nwv/user/aja1
OLSETUP=yes
OPTARG
OPTIND=1
PATH=/usr/bin:/usr/dbin:/usr/ldbin:/usr/X/bin
PPID=660
PS1=\$ 
PS2=> 
PS3=#? 
PS4=+ 
PWD=/home/stu1
RANDOM=3164
SECONDS=56
SHELL=/usr/bin/ksh
TERM=xterm
TERMCAP=/etc/termcap
TZ=:US/Eastern
XDM\_LOGIN=yes
XGUI=MOTIF
XMODIFIERS=@im=Local
XNLSPATH=/usr/X/lib/nls/elsXsi
XWINHOME=/usr/X
_=set

You can use the set command to modify the behavior of the Korn shell. The syntax for this is shown below:

  set -o option               

          or

  set +o option

where option is one of the supported options.

The -o turns on the option you define. The +o argument allows you to turn off the option.

set -o vi

This set option lets you re-use your previous commands that were used in the Korn shell. You can modify your previous commands by using commands from the vi editor.

set -o noclobber

This set option can keep you from over-writing existing files when you are re-directing your output. Normally, if you type ls -al > list_of_files, if a file named list_of_files already existed before you typed that command, it would be overwritten. This option prevents the original file from being overwritten in this manner.

set -o ignoreeof

Normally when you type a ^d character at the command-line prompt, this is the same as the exit character and you are logged out. This set option disables this feature.


up previous next contents
Next: Your Login Files Up: The Korn Shell Previous: The whence Command   Contents