diff options
Diffstat (limited to 'bin/fix_extensions.sh')
-rwxr-xr-x | bin/fix_extensions.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/fix_extensions.sh b/bin/fix_extensions.sh index e3ddd67..9f6113c 100755 --- a/bin/fix_extensions.sh +++ b/bin/fix_extensions.sh @@ -1,5 +1,11 @@ #!/bin/bash +# Tiny helper to rename files based on their detect mimetype. +# +# Call with no trailing slash like: +# +# ./bin/fix_extensions.sh some_dir + for file in $1/*; do TYPE=$(file --mime-type -b "$file" | cut -f2 -d/); if [[ ! $file =~ \.$TYPE ]]; then |