diff options
author | Philip Wittamore <philip@wittamore.com> | 2025-05-08 23:48:43 +0200 |
---|---|---|
committer | Philip Wittamore <philip@wittamore.com> | 2025-05-08 23:48:43 +0200 |
commit | 0ce3c61d9d95aa096d3b50b481ca24049853f658 (patch) | |
tree | fe702ded9493468f31787d19704c4b9e2ae49ecf | |
parent | cc46e89290e766ba442bc08ccfa0c71e0f873793 (diff) | |
download | blog-0ce3c61d9d95aa096d3b50b481ca24049853f658.tar.gz blog-0ce3c61d9d95aa096d3b50b481ca24049853f658.tar.bz2 blog-0ce3c61d9d95aa096d3b50b481ca24049853f658.zip |
update
-rwxr-xr-x | blogarticledate | 17 | ||||
-rwxr-xr-x | blogrss | 1 |
2 files changed, 9 insertions, 9 deletions
diff --git a/blogarticledate b/blogarticledate index 888f06a..6eb73a1 100755 --- a/blogarticledate +++ b/blogarticledate @@ -1,16 +1,17 @@ -#!/bin/sh +#!/usr/bin/env bash # resets blog articles file date to the date indicated # in the article +postDir=/home/philip/web/articles/2025 -postArray=( $(ls *.html) ) +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 + 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 + echo Date="$postdate" + echo Item="$post" + touch -a -m -t "$postdate" "$post" done @@ -70,7 +70,6 @@ if [[ -f $feedname ]]; then rm $feedname fi touch $feedname -#postArray=( $(ls -t "$postDir"/*.html) ) mapfile -t postArray < <(ls -t "$postDir"/*.html) postNum=0 for posts in "${postArray[@]}"; do |