Geoff Clare <g...@opengroup.org> wrote:

> > > 2.
> > >
> > > a='\**'
> > > printf '%s\n' $a
> > >
> > > is a portable script that is meant to list the filenames that
> > > start with "*" in the current directory
> > 
> > See 1), there is just one shell that behaves this way.
>
> And that shell is "bash" (not just "bash5").  All versions I tried do
> it (including bash3 on macOS).

OK, maybe you have something different in mind. Do you talk about this:

If there are the files "*abc.c" and "\abc.c" and you run the above command,
then bash3 prints "*abc.c" while Bourne Shell ksh88 and ksh93 print "\abc.c".

This seems to be a result of the fact that the macro expansion doubles the 
backslash before it is used for globbing and where quote removal is applied 
after globbing.

The question here is whether POSIX should make a complex exception just in 
order to cause a specific result.

> This is simply not true in the case of POSIX.2-1992, and I have
> corrected you on that before.  POSIX.2-1992 deliberately made a number
> requirements that forced implementations to change, including some
> that were invention (an obvious one being pax).

But pax is rarely used in contrary to tar and cannot be called a success story.

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