help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] ${var//!([[:class:]])} removing characters of the [:clas


From: Clark WANG
Subject: Re: [Help-bash] ${var//!([[:class:]])} removing characters of the [:class:]
Date: Sun, 27 Jan 2013 08:52:17 -0800

On Sun, Jan 27, 2013 at 12:27 AM, Pierre Gaston <address@hidden> wrote:
> But I don't know how to explain this result:
>
> $ echo ${v//!(foobar)/xxx}
> xxxxxx

!(foobar) first matches "fooba" (the longest string not matching
foobar) and replaces it with xxx

Makes sense. Thanks.

It then matches the r and replaces it by xxx

and yeah !(pattern) is not the most intuitive glob

Agree.

reply via email to

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