Skip to content

Instantly share code, notes, and snippets.

@fcicq
Created August 4, 2020 04:52
Show Gist options
  • Save fcicq/d8a13df40edcd308aede1f0b76a893d3 to your computer and use it in GitHub Desktop.
Save fcicq/d8a13df40edcd308aede1f0b76a893d3 to your computer and use it in GitHub Desktop.
#!/bin/sh
for file in "$@"; do
[ ! -f "$file" ] && continue
t="$(file "$file" --mime-type -b)"
if [ "$t" = "video/x-ms-asf" ]; then
mv -i "$file" "${file%.*}.wmv"
fi
if [ "$t" = "video/mp4" ]; then
mv -i "$file" "${file%.*}.mp4"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment