Created
November 21, 2017 00:58
-
-
Save inoperable/4a0a119b5edadfe95bf3111904eff873 to your computer and use it in GitHub Desktop.
Recursively remove extended file attributes in OS X
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/bash | |
# Sometimes downloaded files in OS X contain extended attributes that disallow | |
# the files to be accessed by apache. Nuke the site from orbit. | |
rmextattr() { | |
find . | while read filename | |
do | |
while read attr | |
do | |
echo "removing ${attr} from ${filename}" | |
xattr -d "${attr}" "${filename}" | |
done < <(xattr "${filename}") | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment