2017-06-07 09:03:52 +0100, Geoff Clare:
> Stephane Chazelas <stephane.chaze...@gmail.com> wrote, on 06 Jun 2017:
[...]
> > rm -rf ./ ../
> > 
> > AFAICT, with the above wording, that doesn't allow rm
> > implementations to apply that safeguard in those cases (even
> > though it's also a problem with rm -rf .*/).
> 
> No, the standard requires rm to handle those the same as "." and ".."
> because the basename of "./" is "." and the basename of "../" is "..".

Right. I stand corrected. Thanks.

Do you have an opinion on whether POSIX should allow the
expansion of globs not to include "." and ".." by default?

Today, one generally doesn't want for "." and ".." to be included
in the expansion, but on the odd chance that one does,

set -- .*

is not guaranted to have "$@" include them.

$ bash -c 'echo .*'
. .. .git
$ dash -c 'echo .*'
. .. .git
$ ksh93 -c 'echo .*'
. .. .git
$ mksh -c 'echo .*'
.git
$ posh -c 'echo .*'
.git
$ zsh -c 'echo .*'
.git
$ (exec -a sh zsh -c 'echo .*')
.git

-- 
Stephane

Reply via email to