On Sat, 20 Nov 2010, Harald van Dijk wrote:
> On 19/11/10 14:53, Herbert Xu wrote:
> > Harald van Dijk 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
On 19/11/10 14:53, Herbert Xu wrote:
Harald van Dijk 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
Harald van Dijk wrote:
>
> Thanks, that helps to clarify. Unfortunately, the valid alternative
> given there:
>
> sh -c 'echo "${x:-\}}"'
>
> seemingly incorrectly prints \} with dash and with bash, so that is a
> non-option at this time for me.
If you need to print anything involving a bac
On Sat, Nov 13, 2010 at 10:41:47AM -0600, Jonathan Nieder wrote:
> Harald van Dijk wrote:
> > $ ksh -c 'echo "${x:-"}"}"'
> > }
> > $ dash -c 'echo "${x:-"}"}"'
> > dash: 1: Syntax error: Unterminated quoted string
> > $ busybox sh -c 'echo "${x:-"}"}"'
> > sh: syntax error: unterminat
On 13/11/10 17:41, Jonathan Nieder wrote:
Harald van Dijk wrote:
$ dash -c 'echo "${x:-"}"}"'
dash: 1: Syntax error: Unterminated quoted string
http://austingroupbugs.net/view.php?id=221
note #399
Thanks, that helps to clarify. Unfortunately, the valid alternative
given there:
Hi Herald,
Harald van Dijk wrote:
> $ ksh -c 'echo "${x:-"}"}"'
> }
> $ dash -c 'echo "${x:-"}"}"'
> dash: 1: Syntax error: Unterminated quoted string
> $ busybox sh -c 'echo "${x:-"}"}"'
> sh: syntax error: unterminated quoted string
>
> It looks like dash and other ash derivatives
Hi all,
It's probably best to start with the example:
$ bash -c 'echo "${x:-"}"}"'
}
$ ksh -c 'echo "${x:-"}"}"'
}
$ dash -c 'echo "${x:-"}"}"'
dash: 1: Syntax error: Unterminated quoted string
$ busybox sh -c 'echo "${x:-"}"}"'
sh: syntax error: unterminated quoted string
It lo