Created
November 9, 2022 16:59
-
-
Save jaqque/8234def509b248a92db7faba58a6c028 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
usage() { | |
echo "$0 <dir>" | |
} | |
if [ ! "$1" ]; then | |
usage | |
exit 1 | |
fi | |
case "$1" in | |
-h| \ | |
--help) usage; exit 0 ;; | |
--) shift ;; | |
-*) if [ ! -d "$1" ] && [ ! -f "$1" ]; then | |
usage | |
exit 1 | |
fi | |
;; | |
esac | |
while [ "$1" ]; do | |
target="$1"; | |
if [ ! -d "$target" ] && [ ! -f "$target" ]; then | |
echo "$target: no such file or directory" | |
else | |
xattr -d -r com.apple.quarantine "$target" | |
fi | |
shift | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment