Do nothing, returning a zero (true) exit status


'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) does the same thing faster.

'true' ignores all command line arguments, since to do otherwise would change expected behavior that some programmers may be relying on.

“You are never dedicated to something you have complete confidence in. No-one is fanatically shouting that the sun is going to rise tomorrow. When people are fanatically devoted to political or religious faiths or any other kind of dogmas or goals, its always because these dogmas or goals are in doubt” ~ Robert M Pirsig

Related macOS commands

false - Do nothing, unsuccessfully.
yes - Print a string until interrupted.

Copyright © 1999-2024
Some rights reserved