Mailinglist Archive: opensuse (686 mails)

< Previous Next >
Re: [opensuse] bash: how to get file extension
On Monday 15 Jul 2013 11:05:39 lynn wrote:
On Mon, 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"

Scan backwards from the end until you get a "." ?

I've tried these:

ext=${video_title/*./}
ext=${FILENAME##*.}
ext=$(echo "$video_title" | sed 's/^.*\.//')

The problem is the .'s

I want to ignore all .'s until the final one (not just for this string).

Thanks,
L x

** Sorry. Should be:
video_title=
and
ext=${video_title##*.}
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References