Jilles Tjoelker <jil...@stack.nl> wrote:

> However, things like "${a-"*"}" are unspecified (in practice, the
> asterisk may either be literal or generate pathnames, depending on the
> shell). With
>
> cat <<EOF
> ${a-"*"}
> EOF

echo "${a-"*"}"

is equivalent to "echo *" for the Bourne Shell, ksh88, ksh93 and bosh.

${a-"*"} is different, as this quotes "*". Even with this, 
Bourne Shell, ksh88 and bosh behave identical, only ksh93 differs.

What I have in mind for "${a-"*"}" is that there is no special treatment for '"'
in such a string and the only difference between the Bourne Shell and POSIX is 
that ${a... needs to be parsed in a way that does not let the word end before 
the related "}" is seen. This results in ${a- } to be treated as a single word 
(and not as two words as done by the Bourne Shell) and thus permits the macro 
expander to do something useful.

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