[util-iso-log] revert appending untilproperly working

This commit is contained in:
udeved 2016-02-26 20:24:18 +01:00
parent 6d9d72c94d
commit 74d4ff8c0f

View file

@ -27,8 +27,7 @@ error_function() {
# $1: function
run_log(){
local func="$1" name=$(gen_iso_fn)
local tmpfile=/tmp/$name.$func.log logfile=${log_dir}/$name.log
[[ -f $logfile ]] && rm $logfile
local tmpfile=/tmp/$name.$func.log logfile=${log_dir}/$name.$func.log
logpipe=$(mktemp -u "/tmp/logpipe.XXXXXXXX")
mkfifo "$logpipe"
tee "$tmpfile" < "$logpipe" &
@ -36,7 +35,7 @@ run_log(){
$func &> "$logpipe"
wait $teepid
rm "$logpipe"
cat $tmpfile | perl -pe 's/\e\[?.*?[\@-~]//g' >> $logfile
cat $tmpfile | perl -pe 's/\e\[?.*?[\@-~]//g' > $logfile
rm "$tmpfile"
}