Robert Elz <k...@munnari.oz.au> wrote:

> But it looked right, so I changed (not yet committed, nor are the other
> bug fixes I have made to this) the NetBSD sh to produce the same
> result as bash:
>
>       ${SH} -c 'var="[a-e]\\?.*";printf "%s\n" ${var}'
>       a?.??
>       b?.??
>       c?.??
>       e?.??

This would be a mistake.

> Then I started pondering other quote characters, since the quote
> characters are still in the string, that is, if the command were
>
>       $SHELL -c 'printf "%s\n" [a-e]\?.*'

This is a different example, as you here have a quoted '?' instead of a quoted 
\ as in the first example.


> (here it is important that there just be one '\') all shells agree, that the
> result where the 4 file names are printed is correct.  For example:
>
>       bosh  -c 'printf "%s\n" [a-e]\?.*'
>       a?.??
>       b?.??
>       c?.??
>       e?.??

See above, a different example results in a different behavior.

> In your earlier reply you said ...
>
>   | The result of a shell macro expansion is quoted internally before quote
>   | removal  is applied.
>
> but I cannot find any text anywhere which mandates that, and what's more,
> it is nothing like what really happens:
>
>       bosh -c 'var="???";printf "%s\n" ${var}' | wc -l
>           2297

I am not sure what this should point to.

Jörg

-- 
 EMail:jo...@schily.net                    (home) Jörg Schilling D-13353 Berlin
    joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'

Reply via email to