Created
July 19, 2024 15:31
-
-
Save marcogrcr/54c9d10c78a9c11d9820b1731ae8357a to your computer and use it in GitHub Desktop.
A POSIX-compatible recursive iteration over each file
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
#!/bin/sh | |
folder_path='...' | |
file_types='*.json' | |
# See https://www.shellcheck.net/wiki/SC2044 for why we loop this way | |
find "$folder_path" ! -name "$(printf "*\n*")" -name "$file_types" | while IFS= read -r file | |
do | |
echo "Processing $file..." | |
# process $file | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment