Bash Remove Extension

Bash Remove Extension

Published on 2015/07/03 01:28:191 min read

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
Gavin Mogan
Burnaby, BC, Canada

I'm a software developer at the awesome Sauce Labs. I do a bunch of other random open source development. I also play games, both board and video games and love to read. You can usually find me on various services as halkeye.

Comments
arrow_back

Previous

Nginx + Cloudflare SSL

Next

“The Secret Loves of Geek Girls”
arrow_forward