blob: 974da17af9f0ea7e5f6725442b55a3adcf45565a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
function rsxattr --description 'Recursively delete all user xattrs'
if not check_install 'getfattr' 'attr'
echo "Can't find xattr tools."
return 1
end
if not check_install 'awk' 'gawk'
echo "Can't find awk."
return 1
end
for file in (getfattr -R -h -d . &>/dev/null | grep '^# file:' | sed 's/^# file: //')
for attr in (getfattr -m '^user\.' "$file" &>/dev/null | awk '/^[^#]/ {print $1}')
setfattr -x $attr $file &>/dev/null
end
end
end
|