summaryrefslogtreecommitdiffstats
path: root/logs/filter.sh
blob: 675fb90f71f5fb6f2bbe30d91beeeccd3c941866 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#! /bin/bash

re=""
while IFS= read -r line; do
    IFS="#" read -ra  filter <<< "$line"
    if [ -n "$filter" ]; then
	[ -n "$re" ] && re+="|"
	re+=$(echo "$filter" | sed 's/[[:space:]]\+$//')
    fi
done < "filters.txt"

cat - | grep -viP "($re)"