Mailinglist Archive: opensuse (686 mails)

< Previous Next >
Re: [opensuse] bash: how to get file extension
On 07/15/2013 11:01 AM, lynn wrote:
How do I get the mp4 from this?
video_id="Robin Thicke - Blurred Lines ft. T.I.,
Pharrell-yyDUC1LUXSU.mp4"

man bash

v="some.file.ext"

$ echo "${v%.*}"
some.file

$ echo "${v%%.*}"
some

$ echo "${v#*.}"
file.ext

$ echo "${v##*.}"
ext

Have a nice day,
Berny
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References