From d5b60afe75ce629efa33480e65bed6d706be1da9 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Sat, 18 Jun 2022 11:06:16 +0200 Subject: [PATCH] Added script to clean up filter.txt --- README.md | 1 + sort_and_remove_double_entries.sh | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100755 sort_and_remove_double_entries.sh diff --git a/README.md b/README.md index a0dd448..16c0e5f 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ heise.de::TechStage | ## Misc - [tborychowski/miniflux-filter](https://github.com/tborychowski/miniflux-filter) - [jqplay.org](https://jqplay.org) +- To clean up your `filter.txt` you can use the following script: `./sort_and_remove_double_lines.sh` ### Debug If `MF_DEBUG` is set to `1`, `miniflux-filter` will print extra output to stdout. diff --git a/sort_and_remove_double_entries.sh b/sort_and_remove_double_entries.sh new file mode 100755 index 0000000..876c3b2 --- /dev/null +++ b/sort_and_remove_double_entries.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +FILTERFILE=./filter.txt +VORHER=$(wc -l < $FILTERFILE) +echo Sortiere und filtere doppelte Zeilen heraus. +sort filter.txt | uniq -u -i | cat > .tmp +NACHHER=$(wc -l < .tmp) +echo Es wurden $((VORHER-NACHHER)) Zeilen entfernt! +mv -f .tmp filter.txt