[util-iso-log] revert appending untilproperly working
This commit is contained in:
parent
6d9d72c94d
commit
74d4ff8c0f
1 changed files with 2 additions and 3 deletions
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue