Re: [Help-bash] Things like ${parameter^} only works with path expansion
From:
Chet Ramey
Subject:
Re: [Help-bash] Things like ${parameter^} only works with path expansion?
Date:
Sat, 11 Apr 2015 13:18:25 -0400
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
On 4/11/15 12:08 PM, Pierre Gaston wrote:
> The pattern after ,, and ^^ only matches one character at a time eg:
> var=hello; echo "${var^^[el]}"
> prints hELLo because the pattern matches the characters e and l.
>
> (not sure what was the idea behind this feature)
Case conversion was a requested feature that wasn't easily available
otherwise. The syntax itself was an experiment.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/