главная|main page

состояние|status

блог|blog

файлы|files

программы|software

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Fenollosa <carlos.fenollosa@gmail.com>2014-03-10 19:18:14 +0100
committerCarlos Fenollosa <carlos.fenollosa@gmail.com>2014-03-10 19:18:14 +0100
commit2a02c34429fd49336eb997e30d3f619f882a22ed (patch)
treeb2018673f365a60c41ab767888a8eec96ca84d32
parent45dee25b3d4b2fc3371a4b3b7216471deec156e1 (diff)
fixed touch on BSD utils
-rwxr-xr-xbb.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/bb.sh b/bb.sh
index 7794b8c..05cd414 100755
--- a/bb.sh
+++ b/bb.sh
@@ -349,6 +349,7 @@ get_html_file_content() {
edit() {
# Original post timestamp
edit_timestamp="$(LC_ALL=$date_locale date -r $1 +"%a, %d %b %Y %H:%M:%S %z" )"
+ touch_timestamp="$(LC_ALL=$date_locale date -r $1 +'%Y%m%d%H%M')"
if [ "$2" = "full" ]; then
$EDITOR "$1"
filename="$1"
@@ -368,7 +369,7 @@ edit() {
filename="$1"
fi
fi
- touch -d "$edit_timestamp" "$filename"
+ touch -t "$touch_timestamp" "$filename"
chmod 644 "$filename"
echo "Posted $filename"
}
@@ -504,7 +505,7 @@ parse_file() {
suffix="$RANDOM"
filename="$(echo $filename | sed 's/\.html/'$suffix'\.html/g')"
done
- # Parse possible tags
+ # Parse possible tags
elif [[ "$line" = "<p>$template_tags_line_header"* ]]; then
tags="$(echo "$line" | cut -d ":" -f 2- | sed -e 's/<\/p>//g' -e 's/^ *//' -e 's/ *$//' -e 's/, /,/g')"
IFS=, read -r -a array <<< "$tags"