#!/bin/sh # resets blog articles file date to the date indicated # in the article postArray=( $(ls *.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