Last active
July 17, 2019 14:20
-
-
Save mdzidic/f752dcc232e91c641e7731ee49e2f440 to your computer and use it in GitHub Desktop.
Batch file extension rename based on fidentify output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
$fileExtension="eCryptfs" | |
for f in *.$fileExtension; do | |
newExtension=$(fidentify $f | awk '{print $2}') | |
mv -- "$f" "${f%.eCryptfs}.$newExtension" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment