blob: 410189045d162ff01738e79491a9892430ab5af9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
function rsxattr --description 'Recursively delete all user xattrs'
if not command -sq 'find'
echo "Can't find find."
return 1
end
if not command -sq 'sed'
echo "Can't find sed."
return 1
end
if not command -sq 'awk'
echo "Can't find awk."
return 1
end
if not command -sq 'setfattr'; and command -sq 'getfattr'
echo "Can't find xattr tools."
return 1
end
for file in (getfattr -R -h -d . 2>/dev/null | grep '^# file:' | sed 's/^# file: //')
for attr in (getfattr -m '^user\.' "$file" 2>/dev/null | awk '/^[^#]/ {print $1}')
setfattr -x $attr $file 2>/dev/null
end
end
end
|