aboutsummaryrefslogtreecommitdiffstats
path: root/bin/fix_extensions.sh
blob: e3ddd67b081682f8422ba681120329decca97c7f (plain)
1
2
3
4
5
6
7
8
#!/bin/bash

for file in $1/*; do
    TYPE=$(file --mime-type -b "$file" | cut -f2 -d/);
    if [[ ! $file =~ \.$TYPE ]]; then
        mv -v "$file" "$file.$TYPE";
    fi
done