Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: parameter and quoting (was: Re: Completion problems.)



Sven Wischnowsky wrote:
> Ah, right, hadn't thought about patterns (ahem)... "${a%'}" reports
> the error.
> 
> Hm. Should the proposed new flag apply to those, too, and change the
> current behaviour to not report the error or should the current
> behaviour of (Q) be changed?

The first possibility sounds sensible to me, too, since ksh allows
you to do

  a="'"
  echo "${a%'}"

although bash complains as well.  It's probably a grey area, since the
single UNIX specification says

   The double-quoting of patterns is different depending on where the
   double-quotes are placed:
   ${x#*}
          The asterisk is a pattern character.
   ${x#"*"}
          The literal asterisk is quoted and not special.

(in the first case they presumably mean the whole expression is quoted), so
properly placed quotes are supposed to be active and this seems to work
OK, i.e. ${a%"'"}.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author