output asked headers in the order they were asked; avoid header name spoofing by...
[hband-tools.git] / user-tools / fdupes-hardlink
blob6042e2f3b3705e285bc59c354a5c7c4b38e577b8
1 #!/bin/bash
3 true <<EOF
4 =pod
6 =head1 NAME
8 fdupes-hardlink - Make hardlinks from identical files as reported by fdupes(1)
10 =cut
12 EOF
15 case "$1" in
16 --scan)
17 shift
18 fdupes -n -1 -r "$@"
20 --from-file)
21 shift
22 while read file1 fileN; do
23 if [ -e "$file1" ]; then
24 for file in $fileN; do
25 ln -f -v "$file1" "$file"
26 done
28 done <"$1"
31 echo \
32 "Makes hardlinks from identical files as reported by fdupes(1).
34 USAGE
35 Create duplication report: $0 --scan [directories] > [report-file]
36 Make hardlinks according to duplication report: $0 --from-file [report-file]
38 BUGS
39 Does not work with files have IFS in their name." >&2
40 exit 1
42 esac