Bernhard Voelker [15.07.2013 12:36]:
On 07/15/2013 12:08 PM, lynn wrote:
It's nice and short but it only works if you know the number of .'s:(
Why?
"${v%.*}" strips off everything past and including the last dot, while "${v%%.*}" strips off everything past and including the first dot.
Likewise, "${v#*.}" returns everything past the first dot, and "${v##*.}" gives everything past the last dot.
So in your case - as you want the file extension - the best bet is "${video_id##*.}" which will return "mp4".
Yes, it should - but in <1373879139.4191.8.camel@hh16.hh3.site> he wrote that this does not work for him. So I looked for a far more complicated way. Just my 2¢, Werner -- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org