Hello Eric.

On Monday 21 February 2011, Eric Blake wrote:
> On 02/20/2011 04:39 AM, Stefano Lattarini wrote:
> >>> -    find "$$@" -type d '!' -perm -200 -exec chmod u+w {} ';'; \
> >>> +    find "$$@" -type d ! -perm -700 -exec chmod u+rwx {} ';'; \
> >>>      rm -rf "$$@"; \
> >>>    fi;
> >>
> >> please don't remove the quoting from the ! here.  It exists to
> >> facilitate copy and pasting commands from make output to the command
> >> line,
> >>
> > Why would the quoting being useful for that?  As long as '!' is
> > whitespace-separated from the following word, it's regarded by
> > the shell as a literal character, even when the shell has history
> > substutution enabled, no?  Or am I missing something?
> 
> You're missing history expansion.
>
No, I'm not (but I did use a botched terminalogy, sorry about that);
quoting from above:
 ``As long as '!' is whitespace-separated from the following word, it's
   regarded by the shell as a literal character, *even when the shell
   has history substutution enabled*''
Just do 's/history substutution/history expansion/', and you'll see
what I really meant.

> ! is special in some interactive shells when not in POSIX mode.
>
See above.

> It's better to quote ! than to risk a spurious history expansion.
> 
IMVHO adding an extra quoting is overkill unless you can point to a
shell that performs history expansion also for whitespace-separated
`!'.  That said, I have no strong feeling on the matter, so if you
want to provide a patch anyway I think there might be good chances
that Ralf will accept it (and I certainly won't object).

Regards,
   Stefano

Reply via email to