GNU's /bin/true

Shlomi Fish <shlomif-ik1l9ssToec+JF/[email protected]> Sat, 23 Feb 2008 10:51:27 +0200
Newsgroups gmane.culture.hackers.israel
Message-ID <[email protected]>
Hi all.

Inspired by the bit about the Solaris true here:

http://thedailywtf.com/Articles/The-Comcast-Bill,-A-Buggy-Traffic-Light,-and-More.aspx

I decided to see how my GNU/Linux's /bin/true is all about. "less /bin/true" 
indicated it was a binary executable and had many symbols to show for 
(including many printf-formats). And:

<<<<
$ ls -l /bin/true
-rwxr-xr-x 1 root root 23468 2008-01-29 13:21 /bin/true
>>>>

I wondered why it should be so large, given all it had to do was "return 0;", 
and so I did "man true":

<<<<<<<<<<<<<<
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 super‐
       sedes the version described here.  Please refer to your  shell's  docu‐
       mentation for details about the options it supports.
>>>>>>>>>>>>>

I laughed quite a bit seeing it accepts some command-line arguments.

Then I tried "true --help" and "true --version" which didn't print anything 
because they were the shell's built-in true command. So I did the same 
with "/bin/true --help" and "/bin/true --version":

<<<<<<<<<<<<<<<<<<<
shlomi:~$ /bin/true --help
Usage: /bin/true [ignored command line arguments]
  or:  /bin/true OPTION
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.

Report bugs to <bug-coreutils-mXXj517/[email protected]>.
shlomi:~$ /bin/true --version
true (GNU coreutils) 6.10
Copyright (C) 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.

Written by Jim Meyering.
shlomi:~$
>>>>>>>>>>>>>>>>>>>>

So now I no longer wonder why it is so bloated.

What would we do without GNU?

Regards,

	Shlomi Fish

---------------------------------------------------------------------
Shlomi Fish      shlomif-ik1l9ssToec+JF/[email protected]
Homepage:        http://www.shlomifish.org/

I'm not an actor - I just play one on T.V.