Yes, I'm familiar with that old bit of cleverness. :) Note that the GNU coreutils stripped /bin/true and /bin/false executables are more than an order of magnitude larger than the *starting* binary that is whittled down in that demonstration. Now, *that* is code bloat.
To be fair getting your executable much smaller than the minimal disk block size is just a fun exercise. Whereas coreutils /bin/true may actually benefit from an extent based filesystem. :) Anyway, it's just a silly complaint I'm making, though it has always annoyed me a tiny bit.
Disk space (was: SELF: Anatomy of an (alleged) failure)
Posted Jun 25, 2010 12:25 UTC (Fri) by dark (subscriber, #8483)
[Link]
Yes, but GNU true does so much more! It supports --version, which tells you all about who wrote it and about the GPL and the FSF. It also supports --help, which explains true's command-line options (--version and --help). Then there is the i18n support, so that people from all over the world can learn about --help and --version. You just don't get all that with a minimalist ELF binary.
Disk space (was: SELF: Anatomy of an (alleged) failure)
Posted Jun 25, 2010 15:38 UTC (Fri) by intgr (subscriber, #39733)
[Link]
Indeed, I use those features every day! ;)
PS: Shells like zsh actually ship builtin "true" and "false" commands
Disk space (was: SELF: Anatomy of an (alleged) failure)
Posted Jun 29, 2010 23:03 UTC (Tue) by peter-b (subscriber, #66996)
[Link]
So does POSIX sh. The following command is equivalent to true: