Previous Table of Contents Next


Tilde Expansion

Feature Korn C
Tilde represents user's home directory ~ ~~loginid ~ ~loginid
Tilde represents current and previous directories ~+ ~-- N/A

Alias Syntax

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

History Syntax

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 !!

Function Syntax

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

Programming Statement Syntax

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