From 4ea22be4126a2511e4fa92231b912bfa3e460533 Mon Sep 17 00:00:00 2001 From: subtleq Date: Thu, 6 Jun 2013 18:01:22 -0600 Subject: [PATCH] Fix For "BSD 'date' does not have the -R option" modified date calls on lines 514, 515, 531, and 628 to use +"%a, %d %b %Y %H:%M:%S %z" in place of -R for compatibility with BSD systems. This commit has not been tested, but should work. --- bb.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bb.sh b/bb.sh index 1b3ef15..be623c2 100755 --- a/bb.sh +++ b/bb.sh @@ -511,8 +511,8 @@ make_rss() { echo '' >> "$rssfile" echo ''$global_title''$global_url'' >> "$rssfile" echo ''$global_description'en' >> "$rssfile" - echo ''$(date -R)'' >> "$rssfile" - echo ''$(date -R)'' >> "$rssfile" + echo ''$(date +"%a, %d %b %Y %H:%M:%S %z")'' >> "$rssfile" + echo ''$(date +"%a, %d %b %Y %H:%M:%S %z")'' >> "$rssfile" echo '' >> "$rssfile" n=0 @@ -528,7 +528,7 @@ make_rss() { echo "]]>$global_url/$i" >> "$rssfile" echo "$global_url/$i" >> "$rssfile" echo "$global_author" >> "$rssfile" - echo ''$(date -r "$i" -R)'' >> "$rssfile" + echo ''$(date -r "$i" +"%a, %d %b %Y %H:%M:%S %z")'' >> "$rssfile" n=$(( $n + 1 )) done @@ -625,7 +625,7 @@ rebuild_all_entries() { awk '//, //{if (!// && !//) print}' "$i" >> "$contentfile" # Original post timestamp - timestamp="$(date -R -r $i)" + timestamp="$(date -r $i +"%a, %d %b %Y %H:%M:%S %z" )" create_html_page "$contentfile" "$i.rebuilt" no "$title" "$timestamp" # keep the original timestamp!