-
Notifications
You must be signed in to change notification settings - Fork 10
/
run_and_log
executable file
·25 lines (22 loc) · 943 Bytes
/
run_and_log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# SEALS : run-and-log
# Part of the SEALS opensource project (https://github.com/kaiwan/seals)
# logfile_post_process
# Issue: using the 'color' routines (like wecho, aecho, techo, etc) causes
# escape chars to get embedded into the logfile. This addresses how to get
# rid of the color escape sequences.
# Set Bash unofficial 'strict mode'; _really_ helps catch bugs
# ref: http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
logfile_post_process()
{
sed -i.bkp "/###\:\:\:/d" ${1} # take a backup & get rid of the signature line
sed -i "s/\x1b.....//g" ${1} # get rid of the ^[(B^[[m characters !
# '\x1b' is ESC ! Find it, and then delete it and the following 5 chars
# (the five .'s that follow specify this)
}
LOG=log_seals.txt
# stderr to tee is causing issues with 'menuconfig' target
# but now no stderr logging??
./build_SEALS.sh | tee -a ${LOG}
logfile_post_process ${LOG}
ls -lh ${LOG}