aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed <git@gumx.cc>2026-06-01 22:33:53 +0300
committerAhmed <git@gumx.cc>2026-06-01 22:33:53 +0300
commitd3ce5022d76b0784486593f023f1c0dd20f8ec93 (patch)
treec979bcf80951b15ba18f299d18cba9af876d1339
parentae72b8f9976a1c0cca66ff4cb31eadf311c677e7 (diff)
fix: grep interoperability
-rwxr-xr-xbuild.sh6
1 files 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