utils/bash/bashrc/sources/60_diagnostics

22 lines
424 B
Bash
Executable File

#!/bin/bash
function catlog () {
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
EXCLUDE=$(awk '{ printf("(%s)|", $1) }' ~/.settings/checklog_exclude | sed 's/|$//')
if [ $GZIP ]; then
gunzip -c $1 | egrep -v $EXCLUDE
else
egrep -v $EXCLUDE $1
fi
fi
}