true (Unix)

from Wikipedia, the free encyclopedia

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 . stdoutremains 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 truefor reasons of compatibility, the Default is retained. Instead, the null command ( ) is recommended under Application Usage . :

See also

Web links

Individual evidence

  1. a b The Open Group Base Specifications Issue 7, 2018 edition; IEEE Std 1003.1-2017 (Revision of IEEE Std 1003.1-2008)
  2. literally (ibid.): The special built-in utility :is sometimes more efficient than true .