true
Do nothing, successfully (exit with 0)
Overview
The `true` command does nothing except exit with a status code of 0, which indicates success. It is often used in shell scripts to create infinite loops or to provide a command that always succeeds.
Syntax
true [ignored_arguments]Common Options
[arguments]Any arguments provided are typically ignored.
--help(GNU version) Display help and exit.
--version(GNU version) Output version information and exit.
:In many shells (like Bash), the colon `:` is a built-in command synonymous with `true` and is often more efficient.
Examples
Exits with a status code of 0.
The commands within the `if` block will always execute.
Creates an infinite loop that executes once due to `break`.
Using the colon built-in as a `true` equivalent.