Created
June 16, 2020 05:56
-
-
Save emanuelvintila/00f3a0dae440cec87c64209471fbb5f7 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
if [[ $# -lt 2 ]]; then | |
echo "The script requires at least 2 arguments." | |
exit 1 | |
fi | |
copy_dir="$1" | |
shift | |
while [[ $# -ne 0 ]]; do | |
dir="$1" | |
shift | |
if [[ -d "$dir" ]]; then | |
find "$dir" -type f -perm -u+rwx -exec cp "{}" "$copy_dir" \; | |
fi | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment