update instpkg todo list
[cmdllinux.git] / searchfs / _find_dup.sh
bloba07df0a3f26e57b76a425cdef090c2cf4dd83dae
1 ##! ":" char
2 ##todo deal with [[:space:]] filename
3 export LC_COLLATE=C
4 IFS=$'\n'
5 find -type f | while read file; do
6 FILE=${file##*/}
7 DIR=${file%/*}
8 echo "$FILE:$DIR"
9 done > /tmp/file1
11 sort /tmp/file1 > /tmp/file2
13 OPKG=
14 DEPP=
15 while read line; do
16 PKG=${line%%:*}
17 DEP=${line##*:}
18 if [[ "$OPKG" != "$PKG" ]]; then
19 if [[ -z "$OPKG" ]]; then
20 DEPP="$DEP"
21 else
22 echo "$OPKG:$DEPP"
23 DEPP="$DEP"
25 OPKG="$PKG"
26 else
27 [[ -z "$DEPP" ]] && DEPP="$DEP" || DEPP="$DEPP $DEP"
29 done < /tmp/file2 > /tmp/file3
30 ##!notice! check we went through while :[[]]
31 [[ ! -z "$PKG" ]] && echo "$PKG:$DEPP" >> /tmp/file3
33 grep "^.*:.*[[:space:]]\+.*$" /tmp/file3