gz support for catlog
This commit is contained in:
parent
4de0812ce7
commit
d22fc76b30
@ -2,12 +2,23 @@
|
||||
|
||||
function catlog () {
|
||||
if [[ -z "$1" ]]; then
|
||||
__func_head "FILE"
|
||||
__func_head "[z] FILE"
|
||||
echo " Will exclude:"
|
||||
cat ~/.settings/checklog_exclude | awk '{ print " "$1 }'
|
||||
echo
|
||||
else
|
||||
GZIP=false
|
||||
if [ "$1" == "z" ]; then
|
||||
GZIP=true
|
||||
shift
|
||||
fi
|
||||
|
||||
EXCLUDE=$(awk '{ printf("(%s)|", $1) }' ~/.settings/checklog_exclude | sed 's/|$//')
|
||||
egrep -v $EXCLUDE $1
|
||||
|
||||
if $GZIP; then
|
||||
gunzip -c $1 | egrep -v $EXCLUDE
|
||||
else
|
||||
egrep -v $EXCLUDE $1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user