: (colon)expand arguments and do nothing, successfully |
KornShell Built-in |
|
: [
argument...]
The
: (colon) command simply yields an exit status of
zero (success).
It does expand its arguments but does nothing with them.
This can be surprisingly useful, for example, when you are evaluating
shell expressions for their side effects.
: ${VAR:="default value"}
sets
VAR to a default value if and only if it is not
already set.
Since this command always succeeds, the only possible exit status is:
- 0
- Successful completion.
POSIX.2.
x/OPEN Portability Guide 4.0.
This is a special built-in command of the MKS KornShell.
- Commands:
sh,
true