true (Unix)
true ( /bin/true
) is a program in Unix systems. Its behavior is standardized for UNIX systems by the POSIX standard.
During execution, the program delivers the return value 0, which, according to convention, is interpreted by shells or their branching constructs as logically true or correct . stdout
remains empty. Its other behavior corresponds to that of other command line programs.
In some shells true is implemented as a built-in in order to save the additional fork () that is otherwise necessary and thus improve the execution speed, but the POSIX standard (Base Specifications Issue 7, 2018 Edition) states that true
for reasons of compatibility, the Default is retained. Instead, the null command ( ) is recommended under Application Usage .
:
See also
Web links
-
true(1)
: BSD variant - OpenBSD General Commands Manual -
true(1)
: GNU variant - Debian GNU / Linux Executable programs or shell commands man page
Individual evidence
- ↑ a b The Open Group Base Specifications Issue 7, 2018 edition; IEEE Std 1003.1-2017 (Revision of IEEE Std 1003.1-2008)
-
↑ literally (ibid.): The special built-in utility
:
is sometimes more efficient than true .