Monday, January 30, 2012

The /bin/true Command and Copyright

John Chambers (via Uli Kusterer):

This is a “dummy” library program whose main function is to make it easy to write infinite loops (while true do …) in shells scripts. The “true” program does nothing; it merely exits with a zero exit status. This can be done with an empty file that’s marked executable, and that’s what it was in the earliest unix system libraries. Such an empty file will be interpreted as a shell script that does nothing, and since it does this successfully, the shell exits with a zero exit status.

Comments RSS · Twitter

Leave a Comment