waypoint
This commit is contained in:
1 parent
ff76074355
commit
db7a9c4324
5 files changed
+223
No files matched your search
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
if [ -z "$1" ]; then
|
||||
echo -e 'Usage:\n\tfind_ext.sh <str extensions whitelist> <str extensions blacklist>\n\tfind_ext.sh "jpg mp3 png" ["doc pdf svg"]'
|
||||
exit 1
|
||||
else
|
||||
# start the whitelist group
|
||||
whitelist_find_str='\('
|
||||
|
||||
# break whitelist str into array
|
||||
IFS=' ' read -r -a whitelist <<< "$1"
|
||||
|
||||
# loop through array of whitelisted exts
|
||||
for ext in "${whitelist[@]}"; do
|
||||
whitelist_find_str+=" -iname \" *.${ext}\" "
|
||||
done
|
||||
|
||||
# finish the whitelist group
|
||||
whitelist_find_str+='/)'
|
||||
|
||||
echo "$whitelist_find_str";
|
||||
|
||||
# make find command
|
||||
# find_cmd="find . "
|
||||
fi
|
||||
|
||||
if [ ! -z "$2" ]; then
|
||||
# break blacklist str into array
|
||||
IFS=' ' read -r -a blacklist <<< "$2"
|
||||
fi
|
||||
Reference in new issue
Block a user