[Gloucs] bash Q

Glyn Davies glynd at walmore.com
Sun May 13 16:31:35 BST 2007


Keith Edmunds wrote:
> On Sun, 13 May 2007 16:06:21 +0100
> Glyn Davies <glynd at walmore.com> wrote:
>
>   
>> In short, how can you obtain the part of the filename after the last '.'?
>>     
>
> lastpart=${filename##*.}
>
> For example:
>
> $ cat=dog.and.the.mouse
> $ echo $cat
> dog.and.the.mouse
> $ x=${cat##*.}
> $ echo $x
> mouse
>
> hth,
> Keith
>
>
>   
Wow. Excellent.

Cheers Keith.

-- 
Best Regards
Glyn Davies



More information about the gloucs mailing list