fix
[hband-tools.git] / user-tools / cpyfattr
blob0b1597c961340f3a255f43612edec5201bd64f12
1 #!/bin/bash
3 true <<'EOF'
4 =pod
6 =head1 NAME
8 cpyfattr - Copy file attributes (xattr)
10 =head1 SYNOPSIS
12 cpyfattr I<SOURCE> I<DESTINATION> [I<OPTIONS>]
14 =head1 DESCRIPTION
16 Copy I<SOURCE> file'Z<'>s all xattributes to I<DESTINATION>
17 using getfattr(1) and setfattr(1).
19 =head1 OPTIONS
21 All options passed to setfattr(1).
22 Note that I<OPTIONS> are at the end of argument list.
24 =head1 SEE ALSO
26 getfattr(1), setfattr(1)
28 =cut
30 EOF
34 set -e
35 set -o pipefail
36 set -u
38 source=$1
39 shift
40 dest=$1
41 shift
44 echo "# file: $dest"
45 getfattr -d "$source" | sed -e 1d
46 } | setfattr --restore=- "$@"