Created
June 5, 2023 12:29
-
-
Save Integralist/ceede527325efbfd320944677b30197b to your computer and use it in GitHub Desktop.
[find files asynchronously] #xargs #async #find
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/bash | |
replacement_patterns() { | |
echo "Processing file: $1" | |
} | |
replacement_patterns "$@" |
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
# on macOS we have to use a separate shell process with a separate script file for async processing to work... | |
find "/Users/integralist/Code/path/to/directory" -type f -print0 | xargs -0 -P "$(nproc)" -n 1 bash -c './async.sh "$@"' _ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment