From afaca0a0b66eada1ba3662946d1c2866ae7d2ed8 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 7 Apr 2021 11:46:50 -0400 Subject: [PATCH] here string removed --- .local/bin/rssadd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/rssadd b/.local/bin/rssadd index fb60be8..910fca3 100755 --- a/.local/bin/rssadd +++ b/.local/bin/rssadd @@ -1,12 +1,12 @@ #!/bin/sh -if echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null; then +if echo "$1" | grep -q "https*://\S\+\.[A-Za-z]\+\S*" ; then url="$1" else url="$(grep -Eom1 '<[^>]+(rel="self"|application/[a-z]+\+xml)[^>]+>' "$1" | - sed -E 's_^.*href="(https?://[^"]+)".*$_\1_')" + grep -o "https?://[^\" ]")" - ! grep "https*://\S\+\.[A-Za-z]\+\S*" <<<"$url" && + echo "$url" | grep -q "https*://\S\+\.[A-Za-z]\+\S*" || notify-send "That doesn't look like a full URL." && exit 1 fi