- always overwrite log file, do not append
# use teeboth Perl wrapper
# temporary option to disable if broken
# use teeboth Perl wrapper
# temporary option to disable if broken
local efile rc logfile=$1; shift
if [ "$logfile" ]; then
efile=$(tempfile)
local efile rc logfile=$1; shift
if [ "$logfile" ]; then
efile=$(tempfile)
- { "$@" 2>&1; echo $? > $efile; } | tee -a $logfile
+ { "$@" 2>&1; echo $? > $efile; } | tee $logfile
rc=$(< $efile)
rm -f $efile
else
rc=$(< $efile)
rm -f $efile
else