TRUE(1) User Commands TRUE(1)
NAME
true - do nothing, successfully
SYNOPSIS
true [ignored command line arguments]
true OPTION
DESCRIPTION
Exit with a status code indicating success.
--help display this help and exit
--version
output version information and exit
NOTE: your shell may have its own version of true, which usually
supersedes the version described here.
Please refer to your shell's documentation for details about the
options it supports.
AUTHOR
Written by Jim Meyering.
REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.
COPYRIGHT
Copyright <co> 2008 Free Software Foundation, Inc. License
GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute
it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
The full documentation for true is maintained as a Texinfo manual. If
the info and true programs are properly installed at your site, the
command
info true
should give you access to the complete manual.
GNU coreutils 6.10 August 2008 1
|
|
File: coreutils.info, Node: true invocation, Next: test invocation,
Prev: false invocation, Up: Conditions
16.2 `true': Do nothing, successfully
=====================================
`true' does nothing except return an exit status of 0, meaning
"success". It can be used as a place holder in shell scripts where a
successful command is needed, although the shell built-in command `:'
(colon) may do the same thing faster. In most modern shells, `true' is
a built-in command, so when you use `true' in a script, you're probably
using the built-in command, not the one documented here.
`true' honors the `--help' and `--version' options.
Note, however, that it is possible to cause `true' to exit with
nonzero status: with the `--help' or `--version' option, and with
standard output already closed or redirected to a file that evokes an
I/O error. For example, using a Bourne-compatible shell:
$ ./true --version >&-
./true: write error: Bad file number
$ ./true --version > /dev/full
./true: write error: No space left on device
This version of `true' is implemented as a C program, and is thus
more secure and faster than a shell script implementation, and may
safely be used as a dummy shell for the purpose of disabling accounts.
|