Bash Remove Extension

I can't imagine me ever needing this again, but it does highlight bash's ability to strip extensions.

To convert avis to mkv's and update language from unknown to english:

for i in *.avi; do
  mkvmerge -o "${i%.avi}.mkv" "$i" \
  && mkvpropedit "${i%.avi}.mkv" --edit track:a1 \
  --set language=rus --edit track:a2 --set language=eng;
done

Comments

arrow_back

Previous

Nginx + Cloudflare SSL

Next

“The Secret Loves of Geek Girls”
arrow_forward
Gavin December 1989

Gavin Mogan

Hi. I'm Gavin. I'm a coder at Sauce Labs. At home I code, game, hang out, all the cool non robot things to do. #notarobot

Friends Sites