diff options
author | Andrei Gherzan <andrei@gherzan.ro> | 2012-09-20 12:56:59 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-20 13:33:50 +0100 |
commit | 42d91a7db404bacc50541e1813c537d9c260ffb4 (patch) | |
tree | 5ffa8dd4259197731192f3e6b2d47fc93b3c2f62 /scripts/contrib | |
parent | 82a08d42ffddc4d955706ebe2e0078134574a6ba (diff) | |
download | poky-42d91a7db404bacc50541e1813c537d9c260ffb4.tar.gz |
Replace "echo -e" with "printf" to have the same behavior in dash or bash
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]
(From OE-Core rev: a19880ad10ccb5d7d909dcf9de5c3dc58a0ebcd3)
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib')
-rwxr-xr-x | scripts/contrib/ddimage | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/contrib/ddimage b/scripts/contrib/ddimage index 2cba9b28f1..956699c05d 100755 --- a/scripts/contrib/ddimage +++ b/scripts/contrib/ddimage | |||
@@ -75,7 +75,7 @@ fi | |||
75 | image_details $IMAGE | 75 | image_details $IMAGE |
76 | device_details $(basename $DEVICE) | 76 | device_details $(basename $DEVICE) |
77 | 77 | ||
78 | echo -n "Write $IMAGE to $DEVICE [y/N]? " | 78 | printf "Write $IMAGE to $DEVICE [y/N]? " |
79 | read RESPONSE | 79 | read RESPONSE |
80 | if [ "$RESPONSE" != "y" ]; then | 80 | if [ "$RESPONSE" != "y" ]; then |
81 | echo "Write aborted" | 81 | echo "Write aborted" |