5 ms·
Returning 0 is technically doing something. It might not be something that you find useful but it is something.
by noonespecial 13y ago
Returning 0 is technically doing something. It might not be something that you find useful but it is something.
- badman_ting 13y ago> Returning 0 is technically doing something. Yeah, but try telling your boss that :)
- brongondwana 13y agoYep, boss will turn right around and "do" paying your salary
- Danieru 13y agoOn unix you'll find two programs which do this exact thing: `false` and `true`. False returns 1, and true returns 0. You might not believe that these are real programs but they are. You can find the binaries using `whereis`. For example on my linux install true is /bin/true. The command line is pretty awesome.
- staz 13y agoAnd here are the actual code source for them : http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob_plain;f=src/true.c;hb=HEAD http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob_p... /bin/true source is a bit longer than expected but /bin/false implementation is really interesting : http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob_plain;f=src/false.c;hb=HEAD http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob_p...
- disgruntledphd2 13y agoThat is both hilarious and brilliant. The bin/false source code made me laugh out loud.
- mtdewcmu 13y agotrue.c could be useful as a kind of helloworld -- a minimal example of the conventions followed by gnu command line programs.
- rm445 13y agoGNU Hello exists for this purpose.