From d3ce5022d76b0784486593f023f1c0dd20f8ec93 Mon Sep 17 00:00:00 2001 From: Ahmed Date: Mon, 1 Jun 2026 22:33:53 +0300 Subject: fix: grep interoperability --- build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index b5a9a42..8fedef5 100755 --- a/build.sh +++ b/build.sh @@ -631,9 +631,9 @@ RSSHEAD sort -r "${list_file}" | head -n 20 | while IFS= read -r line; do # Line format: - [DATE] [TITLE](URL) local date title url - date="$(echo "${line}" | grep -oP '\[\K[0-9]{4}-[0-9]{2}-[0-9]{2}(?=\])')" - title="$(echo "${line}" | grep -oP '\]\s+\[\K[^\]]+(?=\]\()')" - url="$(echo "${line}" | grep -oP '\]\(\K[^)]+(?=\))')" + date="$(echo "${line}" | sed -n 's/.*\[\([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\)\].*/\1/p')" + title="$(echo "${line}" | sed -n 's/.*\] \[\([^]]*\)\](.*/\1/p')" + url="$(echo "${line}" | sed -n 's/.*\](\([^)]*\)).*/\1/p')" [[ -z "${date}" || -z "${title}" || -z "${url}" ]] && continue # RFC 2822 date from YYYY-MM-DD -- cgit v1.2.3