utils/bash/bashrc/sources/60_diagnostics

22 lines
424 B
Plaintext
Raw Normal View History

2014-08-04 09:40:25 +00:00
#!/bin/bash
function catlog () {
2018-05-14 10:57:50 +00:00
if [[ -z "$1" ]]; then
__func_head "FILE"
echo " Will exclude:"
cat ~/.settings/checklog_exclude | awk '{ print " "$1 }'
echo
else
GZIP=
file "$1" | grep gzip > /dev/null && GZIP=true
2016-10-17 09:28:34 +00:00
2018-05-14 10:57:50 +00:00
EXCLUDE=$(awk '{ printf("(%s)|", $1) }' ~/.settings/checklog_exclude | sed 's/|$//')
2016-10-17 09:28:34 +00:00
2018-05-14 10:57:50 +00:00
if [ $GZIP ]; then
gunzip -c $1 | egrep -v $EXCLUDE
else
2016-10-17 09:28:34 +00:00
egrep -v $EXCLUDE $1
2018-05-14 10:57:50 +00:00
fi
fi
2014-08-04 09:40:25 +00:00
}