1996-11-22 06:16:00 +08:00
|
|
|
#!/bin/sh
|
1996-11-22 05:58:50 +08:00
|
|
|
|
|
|
|
# note this works for both a.out and ELF executables
|
1997-09-01 23:55:56 +08:00
|
|
|
# it also auto-generates requirment lines for shell scripts
|
1996-11-22 05:58:50 +08:00
|
|
|
|
1996-11-22 06:06:06 +08:00
|
|
|
ulimit -c 0
|
|
|
|
|
1997-09-01 23:55:56 +08:00
|
|
|
filelist=`sed "s/['\"]/\\\&/g"`
|
|
|
|
exelist=`echo $filelist | xargs -r file | fgrep executable | cut -d: -f1 `
|
1997-09-18 01:52:08 +08:00
|
|
|
scriptlist=`echo $filelist | xargs -r file | egrep ":.*(perl |script )" | cut -d: -f1 `
|
1996-11-22 05:58:50 +08:00
|
|
|
|
1997-09-01 23:55:56 +08:00
|
|
|
for f in $exelist; do
|
1997-10-11 03:10:36 +08:00
|
|
|
if [ -x $f ]; then
|
|
|
|
ldd $f | awk '/=>/ { print $1 }'
|
|
|
|
fi
|
1997-03-04 10:08:21 +08:00
|
|
|
done | sort -u | sed "s/['\"]/\\\&/g" | xargs -r -n 1 basename | sort -u
|
1996-11-22 06:16:00 +08:00
|
|
|
|
1997-09-01 23:55:56 +08:00
|
|
|
for f in $scriptlist; do
|
1997-10-11 03:10:36 +08:00
|
|
|
if [ -x $f ]; then
|
|
|
|
head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1
|
|
|
|
fi
|
1997-09-01 23:55:56 +08:00
|
|
|
done | sort -u
|