Mailinglist Archive: opensuse (686 mails)

< Previous Next >
Re: [opensuse] bash: how to get file extension
On Mon, 2013-07-15 at 11:21 +0200, Carlos E. R. wrote:

On Monday, 2013-07-15 at 11:01 +0200, lynn wrote:

Hi everyone
How do I get the mp4 from this?
video_id="Robin Thicke - Blurred Lines ft. T.I.,
Pharrell-yyDUC1LUXSU.mp4"

You can use "basename" to get, well, the base name without the rest. Well,
the rest is considered the path, because "extensions" do not exist in
Linux :-p

But it can remove an extension if it is known in advance. And what you
want is getting the extension, right?

I want only whatever is after the last .
Thanks. I'll have a go with basename but I'd rather do it direct.
L x


--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
References