Name

:

Synopsis

    :

Null command. Returns an exit status of 0. See this Example and the ones under case. The line is still processed for side effects, such as variable and command substitutions, or I/O redirection.

Example

Check whether someone is logged in:

    if who | grep $1 > /dev/null
    then :   # Do nothing if user is found
    else echo "User $1 is not logged in"
    fi

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.