#!/bin/sh
t=`mktemp ${TMPDIR:-/tmp}/straceXXXXXX`

TYPE=${TYPE:-reg}
log=`basename "$1"`

strace -ff -eopen,execve "$@" </dev/null > $t 2>&1 || exit 1
#cat > $t

echo "done strace:"
ls -l $t

cat $t | egrep -o '(execve|open)\([^)]+\)' | \
awk -F'"' '{print $2}' | sort -u | \
egrep -vf filter | tee $TYPE-$log.log

rm -f $t
