[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patches] Fix cross testing for posix/globtest.out

"Joseph S. Myers" <joseph@xxxxxxxxxxxxxxxx> writes:
> I've applied this patch to fix cross testing of the posix/globtest.out 
> test.  "echo -n" is not portable, and when $word is "-e" it simply doesn't 
> work; if echo accepts one option it will accept the other.  "-e" is an 
> option passed to a test program in this test.  Thus I've replaced most 
> uses of echo with printf in this script.

Thanks for fixing this.  I'm surprised that printf is more portable
than echo -n, but I see now that it is so.

I have a question:

>  # Return all input as a properly quoted Bourne shell string.
>  bourne_quote () {
> -    echo -n '"'
> +    printf '%s' '"'
>      sed -n \
>          -e '1h' \
>          -e '2,$H' \

Wouldn't printf '"' work just as well?