January 2001
Intermediate to advanced
480 pages
7h 22m
English
Besides manipulating Korn shell options, the set command can be used to display a list of your local and exported variables.
$ set EDITOR=vi ENV=${HOME:—.}/.env FCEDIT=/bin/ed HOME=/home/anatole LOGNAME=anatole MAILCHECK=600 PATH=:/usr/bin:/usr/ucb:/usr/5bin PPID=180 . . .
It can also be used to "manually" reset positional parameters. For example:
$ set X Y Z
would set $1 to X, $2 to Y, $3 to Z, and $# to 3:
$ print $1 $2 $3 $# X Y Z 3
The positional parameters $@ and $* would be set X Y Z:
$ print $* X Y Z $ print $@ X Y Z
The $* and $@ parameters are basically the same, except for the way they are expanded when surrounded with double quotes. The positional parameters in $@ are interpreted as separate strings, while ...
Read now
Unlock full access