Skip to content

Instantly share code, notes, and snippets.

@jaqque
Created November 9, 2022 16:59
Show Gist options
  • Save jaqque/8234def509b248a92db7faba58a6c028 to your computer and use it in GitHub Desktop.
Save jaqque/8234def509b248a92db7faba58a6c028 to your computer and use it in GitHub Desktop.
#!/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