Previous | Table of Contents | Next |
Feature | Korn | C |
---|---|---|
Tilde represents user's home directory | ~ ~~loginid | ~ ~loginid |
Tilde represents current and previous directories | ~+ ~-- | N/A |
Feature | Korn | C |
---|---|---|
Create new alias | alias name=value | alias name value |
Display current list of values | alias | alias |
Remove alias from list | unalias name | unalias name |
Feature | Korn | C |
---|---|---|
Turn on history | automatic | set history = num |
Display history list | history or fc | history |
Display partial listing | history n m | history n |
history -n | ||
Reexecute a command | r string | ! string |
r number | ! number | |
r | !! |
Feature | Bourne and Korn | C |
---|---|---|
Create a function | func() {commands} | func() {commands} |
function func {commands} | ||
Use a function | Use func as a command | Use func as a command |
Feature | Bourne and Korn | C | |||||
---|---|---|---|---|---|---|---|
If conditional | if command | if (cond) then | |||||
then | commands | ||||||
commands | else if (cond) then | ||||||
elif command | commands | ||||||
commands | else | ||||||
else | commands | ||||||
commands | endif | ||||||
fi | |||||||
Switch and case pattern | case variable in | switch (variable) | |||||
pattern) | case pattern | ||||||
commands;; | commands | ||||||
*) | default: | ||||||
commands;; | commands | ||||||
;;esac | endsw | ||||||
While loops | while command | while (cond) | |||||
do | commands | ||||||
commands | end | ||||||
done | |||||||
For/foreach loops | for variable in list | foreach variable (list) | |||||
do | commands | ||||||
commands | end | ||||||
done |
Previous | Table of Contents | Next |