Improved import-file url regex

sed doesn't remove ALL whitespace, only newlines. It's better to stop at the first whitespace than to stop at a particular, maybe-not-last query string parameter.
This commit is contained in:
Corey Ogburn
2023-05-31 16:31:40 -06:00
parent 89d789fe0f
commit 1b7095fa81

View File

@@ -232,7 +232,7 @@ function import_file() {
log "Exit Code: $exit_code"
if [[ exit_code -eq 0 ]]; then
url=$(echo "$response" | sed ':a;N;$!ba;s/\n//g' | grep -E -o "https://\S*&z=UTC")
url=$(echo "$response" | sed ':a;N;$!ba;s/\n//g' | grep -E -o "https://\S*")
$(echo "$url" > "${SOC_PIPE}")
else
log "false"