[Buildroot] [RFC] Slides "Using Buildroot for real projects"

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Mon Oct 24 17:17:31 UTC 2011


Le Mon, 24 Oct 2011 18:42:06 +0200,
"Yann E. MORIN" <yann.morin.1998 at anciens.enib.fr> a écrit :

> The problem is that /bin/sh might be whatever. With a POSIX-conformant
> /bin/sh (eg. dash), this is true. With bash, it is not. Alas, many
> systems still have bash as /bin/sh.
> 
> $ ls -l /bin/sh
> lrwxrwxrwx 1 root root 4 May 17 23:53 /bin/sh -> bash
> $ echo "bli\nbla"
> bli\nbla
> $ /bin/bash
> $ echo "bli\nbla"
> bli\nbla
> $ exit
> $ /bin/dash
> $ echo "bli\nbla"
> bli
> bla
> 
> The answer it to use printf [0].
> 
> I now use printf as much as I can. printf is in POSIX and does not suffer
> from all the discrepancies there are in the many echo implementations.

Ah, nice to know. Thanks!

For the moment, I've been using echo, knowing that its behavior is not
consistent across systems. But indeed printf is much better.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com


More information about the buildroot mailing list