summaryrefslogtreecommitdiffstats
path: root/find-files.sh
blob: 2094291d7737ea84adcc52626713b108f5a272eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

while read dir; do
  find "$dir" -name '*.debug' -type f -print0 |
  xargs -0 file -N -F ' ' -i |
  awk '
NF == 2 && $2 == "application/x-executable" { print $1 >> "exec" ; next }
NF == 2 && $2 == "application/x-sharedlib" { print $1 >> "dyn" ; next }
NF == 2 && $2 == "application/x-object" { print $1 >> "rel" ; next }
NF == 2 && $2 == "application/x-archive" { print $1 >> "archive" ; next }
{ print "unexpected line:", $0; next }
'
done