bug-bash
[Top][All Lists]
Advanced

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

Re: [bash-testers] Re: case modification operators misbehaviour?


From: Pierre Gaston
Subject: Re: [bash-testers] Re: case modification operators misbehaviour?
Date: Thu, 15 Jan 2009 12:11:13 +0200

On Thu, Jan 15, 2009 at 8:14 AM, Chris F.A. Johnson
<address@hidden> wrote:
> On 2009-01-15, Jan Schampera wrote:
> ...
>> I have another one, maybe my misinterpretion or an unclean documentation:
>>
>> $ TEXT="Test"
>> $ echo ${TEXT^s}
>> Test
>>
>> I expected "TeSt", since the pattern is "s", and the 3rd letter in
>> "Test" matches that, and should be changed. Interesting that it works
>> with ^^s (for "Tesst" then), but for all "s", of course.
>
> man bash4:
>
>     ... the ^ and , expansions match and convert only the first
>     character.

Like that it maybe clear, but since it comes after the definition that
says "each matched characters"
and after the // expansion where a single / means the first match,
it's not difficult to think that
"first character" means "the first matched character" and that matched
has just been omitted.

Imho it would more simple, more intuitive and probably more powerful
if ^^ and ,, were working just like //.




reply via email to

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