[OE-core] [PATCH V2] Replace "echo -e" with "printf" to have the same behavior in dash or bash

Richard Purdie richard.purdie at linuxfoundation.org
Thu Sep 20 12:48:35 UTC 2012


On Thu, 2012-09-20 at 12:56 +0300, Andrei Gherzan wrote:
> oe-core removed the prerequisite to have sh as bash. POSIX doesn't define
> any options and furthermore allows 'echo -e' to be the default behavior.
> This means that in dash 'echo -e' will actually print '-e' and interpret
> backslashes by default. We use instead 'printf' builtin command with or
> without '\n' to simulate 'echo -e' or 'echo -n'.
> 'printf' needs format while 'echo' can be used without any arguments. So
> 'echo >' was replaced by 'printf "" >'.
> 'echo' without '-n' flag adds a new line by default so to keep the same
> behavior of two new lines while using 'echo "\n"', 'printf "\n\n"' is
> used.
> 
> [YOCTO #3138]
> 
> Signed-off-by: Andrei Gherzan <andrei at gherzan.ro>

Merged to master, thanks.

Richard





More information about the Openembedded-core mailing list