true (target)

Return zero (POSIX, toybox)

Syntax:

true

Runs on:

QNX OS

Options:

None.

Description:

The true utility does nothing but exit immediately with a zero exit code.

The true utility is typically used in shell scripts. One common application is to create an infinite loop, as in:

while true
do
   myprogram
   sleep 300
done

which runs myprogram every five minutes (300 seconds) until the shell script is interrupted.

The shell has a builtin true command; see ksh. To make sure you use the executable, specify the full path.

This utility is provided as part of the toybox package. For information on how to enable it, see toybox.

Exit status:

0

Contributing author:

Rob Landley and the toybox project (see https://landley.net/toybox/).

Page updated: