help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Things like ${parameter^} only works with path expansion


From: Pierre Gaston
Subject: Re: [Help-bash] Things like ${parameter^} only works with path expansion?
Date: Sat, 11 Apr 2015 19:33:07 +0300

On Sat, Apr 11, 2015 at 7:11 PM, Peng Yu <address@hidden> wrote:

> On Sat, Apr 11, 2015 at 11:08 AM, Pierre Gaston <address@hidden>
> wrote:
> >
> >
> > On Sat, Apr 11, 2015 at 6:45 PM, Peng Yu <address@hidden> wrote:
> >>
> >> Hi,
> >>
> >> The manual says things like ${parameter^} only works with path
> >> expansion. I just want to make sure I understand it correctly. Pattern
> >> Matching does not work here, right (as demonstrated by the following
> >> example)?
> >>
> >> parameter=abcABC123ABCabc
> >> echo "${parameter,,@(abcABC123ABCabc|ABCABC123ABCABC)}"
> >>
> >> Why this construct does not accept pattern matching, but things like
> >> ${var%%pattern} does? Is it better to make them consistent to avoid
> >> confusions?
> >>
> >> --
> >> Regards,
> >> Peng
> >>
> >
> > The pattern after ,, and ^^ only matches one character at a time
>
> I don't see this documented in the man page. Is there something
> missing in the man page?
>
> my version says:

Case modification.  This expansion modifies the case of alphabetic
characters in parameter.  The pattern is expanded  to  produce  a pattern
just  as  in  pathname  expansion.  Each character in the expanded value of
parameter is tested against pattern, and, if it matches the pattern, its
case is converted.  The pattern should not attempt to match more than one
character.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]