From fd5ca9551ce75d8856451de7928b000cb3b1c779 Mon Sep 17 00:00:00 2001 From: Philip Wittamore Date: Tue, 5 May 2026 21:42:52 +0200 Subject: update --- blogarticledate | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 blogarticledate (limited to 'blogarticledate') 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 '>.*' "$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 -- cgit v1.3-3-g829e