diff --git a/filter.sh b/filter.sh index b18ba19..26b1019 100755 --- a/filter.sh +++ b/filter.sh @@ -178,12 +178,13 @@ function filter_entries { fi # das leerzeichen am anfang ist notwendig, trennt die zahlenwerte # suche in titel - marked_entries+=" $(echo "$unread_entries" | jq --arg url "$url" --arg suchbegriff "$suchbegriff" '.entries[] | select(.feed.site_url | ascii_downcase | contains($url)) | select(.title | ascii_downcase | contains($suchbegriff)) | .id' )" + titles+=" $(echo "$unread_entries" | jq --arg url "$url" --arg suchbegriff "$suchbegriff" '.entries[] | select(.feed.site_url | ascii_downcase | contains($url)) | select(.title | ascii_downcase | contains($suchbegriff)) | .id' )" # suche in content - marked_entries+=" $(echo "$unread_entries" | jq --arg url "$url" --arg suchbegriff "$suchbegriff" '.entries[] | select(.feed.site_url | ascii_downcase | contains($url)) | select(.content | ascii_downcase | contains($suchbegriff)) | .id' )" + content+=" $(echo "$unread_entries" | jq --arg url "$url" --arg suchbegriff "$suchbegriff" '.entries[] | select(.feed.site_url | ascii_downcase | contains($url)) | select(.content | ascii_downcase | contains($suchbegriff)) | .id' )" fi fi # sortiere und forme marked_entries um + marked_entries=$(echo $title $content) # https://unix.stackexchange.com/questions/353321/remove-all-duplicate-word-from-string-using-shell-script # entfernt doppelte eintraege innerhalb einer zeile marked_entries=$(echo marked_entries | xargs -n1 | sort -u | xargs | sed -r 's/\s/\, /g')