From 8a33fd87814b0213c80a674fc8e2dd2eac099bac Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 16 Oct 2023 18:20:50 +0300 Subject: (s2) title is found via awk, instead of grep to reduce dependencies --- csg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/csg b/csg index f3107d6..f781966 100755 --- a/csg +++ b/csg @@ -70,8 +70,7 @@ transform-file() { local scripts="$2" # Markdown stats for a file: title, description, words, date created, date edited - local title="$(grep -m 1 '^# ' "$file")" - local title="${title:2}" + local title="$(awk '/^# / {print substr($0, 2); exit}' "$file")" local descr="$(awk ' /^[[:alpha:]]/ { startedGathering = 1 -- cgit v1.3.1-23-gd82d