Re: Bash substrings – just can’t figure it out…

Johnny Rosenberg gurus.knugum at gmail.com
Tue Jan 31 18:55:24 UTC 2012


2012/1/31 Jonathan Hudson <jh+ubuntu at daria.co.uk>:
> On Tue, 31 Jan 2012 12:31:06 -0600, Cybe R. Wizard wrote:
>
>>On Tue, 31 Jan 2012 19:07:20 +0100
>>Johnny Rosenberg <gurus.knugum at gmail.com> wrote:
>>
>>> I have an example here:
>>> File="03. Rock Nuts.flac"
>>> echo "${File##N*s}"
>>>
>>> The result should be ”03. Rock .flac”, shouldn't it? Obviously not,
>>> because the result is ”03. Rock Nuts.flac”, which is exactly the
>>> original string.
>>> So what am I missing?
>
> That it's a string substitution, not a glob or wildcard match.

What's a ”glob”? English is not my native language, sorry. I try the
best I can though.

> Try
>
> $ echo ${File//N*s}

That worked, but somehow I still don't understand exactly why my
example didn't… *confused*


Kind regards

Johnny Rosenberg
ジョニー・ローゼンバーグ

>
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users




More information about the ubuntu-users mailing list