aboutsummaryrefslogtreecommitdiff
path: root/blogarticledate
blob: 888f06a047272cb88c04d16f627c95615685a089 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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 '>.*</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