[PATCH] fdtget-runtest.sh: Fix failures when /bin/sh isn't bash

Mike Frysinger vapier at gentoo.org
Sat Nov 3 07:26:44 EST 2012


On Tuesday 20 March 2012 22:23:46 Stephen Warren wrote:
> On Ubuntu, /bin/sh is dash (at least by default), and dash's echo doesn't
> accept the -e option. This means that fdtget-runtest.sh's EXPECT file will
> contain "-e foo" rather than just "foo", which causes a test failure.
> 
> To work around this, run /bin/echo instead of (builtin) echo, which has
> more chance of supporting the -e option.
> 
> Another possible fix is to change all the #! lines to /bin/bash rather
> than /bin/sh, and change run_tests.sh to invoke sub-scripts using $SHELL
> instead of just "sh". However, that would require bash specifically, which
> may not be desirable.
> 
> --- a/tests/fdtget-runtest.sh
> +++ b/tests/fdtget-runtest.sh
> 
> -echo -e $expect >$EXPECT
> +/bin/echo -e $expect >$EXPECT

the better fix is to use printf and %b:
	printf '%b\n' "$expect" > $EXPECT
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.ozlabs.org/pipermail/devicetree-discuss/attachments/20121102/e7b226c6/attachment.sig>


More information about the devicetree-discuss mailing list