Created
August 21, 2022 13:34
-
-
Save arthuralvim/81b54a945dad9ee217ebeffbb26e1074 to your computer and use it in GitHub Desktop.
Simple loop in bash.
This file contains 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
cd /path/to/files && | |
for file in *.mp3 *.mp4; do | |
if [[ -f "$file" ]]; then | |
if [[ -f "${file}.md5" ]]; then | |
echo "already exists: ${file}.md5" | |
else | |
md5sum -- "$file" > "${file}.md5"; | |
cat "${file}.md5"; | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment