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