3 # note this works for both a.out and ELF executables
4 # it also auto-generates requirment lines for shell scripts
8 filelist=`sed "s/['\"]/\\\&/g"`
9 exelist=`echo $filelist | xargs -r file | fgrep executable | cut -d: -f1 `
10 scriptlist=`echo $filelist | xargs -r file | egrep ":.* (commands|script) " | cut -d: -f1 `
11 liblist=`echo $filelist | xargs -r file | grep "shared object" | cut -d : -f1 `
15 ldd $f | awk '/=>/ { print $1 }'
17 done | sort -u | sed "s/['\"]/\\\&/g" | xargs -r -n 1 basename | sort -u
20 ldd $f | awk '/=>/ { print $1 }'
21 done | sort -u | sed "s/['\"]/\\\&/g" | xargs -r -n 1 basename | sort -u
23 for f in $scriptlist; do
25 head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1