Re: Quoted closing brace in variable default expansion

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


On 19/11/10 14:53, Herbert Xu wrote:
Harald van Dijk<harald@xxxxxxxxxxx>  wrote:
   sh -c 'echo "${x:-\}}"'

If you need to print anything involving a backspace you should
use printf and not echo.

It's true that backslashes should not be passed to echo, but assuming unset or empty x, "${x:-\}}" should expand to "}", and that is all echo should see.

Cheers,
Harald
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

Powered by Linux