diff options
| author | Joe Carstairs <me@joeac.net> | 2026-06-09 18:20:23 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-06-09 18:20:23 +0100 |
| commit | 87dec12b01315b7b7cad045ba3ce1636d0c87315 (patch) | |
| tree | a4c6780ae7713e6187c93b633bb810013a054f2a /http/bin/cut_longlog_meta | |
| parent | 547db8ac940eee204541ba4d08476b0e3acf3a32 (diff) | |
cut longlog metadata from blog
Diffstat (limited to 'http/bin/cut_longlog_meta')
| -rwxr-xr-x | http/bin/cut_longlog_meta | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/http/bin/cut_longlog_meta b/http/bin/cut_longlog_meta new file mode 100755 index 0000000..914f455 --- /dev/null +++ b/http/bin/cut_longlog_meta @@ -0,0 +1,34 @@ +#!/bin/sh -e + +meta="" +read_published_on=0 +while read line +do + meta="${meta} +${line}" + if [ "$(echo "$line" | cut -c1-14)" = "Published on: " ] + then + read_published_on=1 + break + fi +done + +if [ "$read_published_on" -eq 0 ] +then + echo "$meta" + exit 0 +fi + +read line +if [ "$(echo "$line" | cut -c1-14)" = "Updated: " ] +then + meta="${meta} +${line}" +else + echo "$line" +fi + +while read line +do + echo "$line" +done |
