Skip to content

Instantly share code, notes, and snippets.

@fcicq
Created August 4, 2020 04:52
#!/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