Look at the following implementations of the "echo" command:
http://bxr.su/o/bin/echo/echo.c (OpenBSD)
http://bxr.su/d/bin/echo/echo.c (DragonFly)
http://bxr.su/n/bin/echo/echo.c (NetBSD)
http://bxr.su/f/bin/echo/echo.c (FreeBSD)
http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/echo.c (GNU)
As you go down the list, I'm sure you'll notice the increasing bloat in each implementation. What is the point of a 272 line echo program?
You will notice there is not really that much bloat growth.
Also, most of the time, you're not even running the echo command, most of the time 'echo' invokes a shell built-in. At least on my machine, you have to type
/bin/echo --helpto get all the advanced functionality/documentation out of it, becauseecho --helpmerely echo's--helpFor a good example, run this in your shell.
Then run this:
And you will note vastly different results.
The former will just emit the input as-is, but the latter will print
hellocoloured red.Another example, using the 'hex' code:
Vastly different behaviour. The openbsd implementation cannot to this =).