Skip to content

Instantly share code, notes, and snippets.

@arthuralvim
Created August 21, 2022 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arthuralvim/81b54a945dad9ee217ebeffbb26e1074 to your computer and use it in GitHub Desktop.
Save arthuralvim/81b54a945dad9ee217ebeffbb26e1074 to your computer and use it in GitHub Desktop.
Simple loop in bash.
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