diff options
author | Huy-Ngo <duchuy29092000@gmail.com> | 2021-01-11 16:52:22 +0700 |
---|---|---|
committer | Huy-Ngo <duchuy29092000@gmail.com> | 2021-01-11 16:52:22 +0700 |
commit | dd514ff1971b57c7f3e7922d3beefd244017627a (patch) | |
tree | b1c679f956a18714dbf298e72ac1fdbb26a11ff9 /newpost.sh | |
parent | 2f3dbffd713b0fda91696b147a8f2e739faf8e0a (diff) | |
download | blog-dd514ff1971b57c7f3e7922d3beefd244017627a.tar.gz |
Fix the newpost script
Diffstat (limited to 'newpost.sh')
-rwxr-xr-x | newpost.sh | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/newpost.sh b/newpost.sh index 7918999..d689221 100755 --- a/newpost.sh +++ b/newpost.sh @@ -5,12 +5,13 @@ read tags printf "Categories: " read categories name="_posts/$(date -I)-${title,,}" -name=${name/ /-}.md +name=${name// /-}.md _date=$(date "+%Y-%m-%d %T %z") -echo "---" >> $name -echo "layout: post" >> $name -echo "title: \"$title\"" >> $name -echo "date: $_date" >> $name -echo "tags: $tags" >> $name -echo "categories: $categories" >>$name -echo "---" >> $name +echo $name +echo "---" > "$name" +echo "layout: post" >> "$name" +echo "title: \"$title\"" >> "$name" +echo "date: $_date" >> "$name" +echo "tags: $tags" >> "$name" +echo "categories: $categories" >>"$name" +echo "---" >> "$name" |