#!/bin/bash # Perform a trace on the given command. doTrace() { printMsg info "Executing $*" if [ "z$TT_DO_TRACE" = "ztrue" ] then let I=0 while [ -f ${HOME}/tracefile.${I} ] do let I=I+1 done TRACE_FILE=${HOME}/tracefile.${I} printMsg info "Creating tracefile $TRACE_FILE" strace -q -o ${TRACE_FILE} -f -F -e trace=execve "$@" # Deliberately returning 0 instead of $PIPESTATUS since we don't want the build to error out during strace return 0 else "$@" return $? fi }