diff options
| author | Philip Wittamore <philip@wittamore.com> | 2026-05-31 12:28:54 +0200 |
|---|---|---|
| committer | Philip Wittamore <philip@wittamore.com> | 2026-05-31 12:28:54 +0200 |
| commit | 77b8914d9f233321430f9a9a9947c52de9239a72 (patch) | |
| tree | 06c62d7db00b0d6ec8ecc1a223ed30e9d4fa985e /blogarticledate | |
update
Diffstat (limited to 'blogarticledate')
| -rwxr-xr-x | blogarticledate | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/blogarticledate b/blogarticledate new file mode 100755 index 0000000..6eb73a1 --- /dev/null +++ b/blogarticledate @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# resets blog articles file date to the date indicated +# in the article +postDir=/home/philip/web/articles/2025 + +mapfile -t postArray < <(ls -t "$postDir"/*.html) +for posts in "${postArray[@]}"; do + post="$posts" + postdate=$(grep -o '>.*</h5>' "$post" | sed 's/\(>\|<\/h5>\)//g') + echo "$postdate" + #[[CC]YY]MMDDhhmm[.ss] + postdate="${postdate//-}0000" + echo Date="$postdate" + echo Item="$post" + touch -a -m -t "$postdate" "$post" +done |
