: (colon) — Do nothing, successfully

Format

: [argument ]

tcsh shell: :

Description

The : (colon) command is used when a command is needed, as in the then condition of an if command, but nothing is to be done by the command. This command simply yields an exit status of zero (success). This can be useful, for example, when you are evaluating shell expressions for their side effects.

colon is a special built-in shell command.

In the tcsh shell, colon performs as indicated for the z/OS version of : (colon).

Examples

: ${VAR:="default value"}
sets VAR to a default value if and only if it is not already set.

Localization

colon uses the following localization environment variables:
  • LANG
  • LC_ALL
  • LC_MESSAGES
  • NLSPATH

See Localization for more information.

Exit values

Because this command always succeeds, the only possible exit status is:
0
Successful completion

Portability

POSIX.2, X/Open Portability Guide, UNIX systems.

Related information

sh, tcsh, true