tBetter conversion of post titles - monochromatic - monochromatic blog: http://blog.z3bra.org
(HTM) git clone git://z3bra.org/monochromatic
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit 812ac9caab2598a7eb55b61fe0f4991b354bcdcf
(DIR) parent 041a2d14fa4dc88a9b0be196586d03cab85fb982
(HTM) Author: z3bra <willy@mailoo.org>
Date: Sat, 14 Feb 2015 00:54:13 +0100
Better conversion of post titles
Diffstat:
M post.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
(DIR) diff --git a/post.sh b/post.sh
t@@ -4,7 +4,7 @@
read -p "Post title: " title
# use post title to name the file
-file=`echo ${title}| sed "s/\s\+/-/g;s/./\L&/g;s/[,.?!;\"']//g"`.txt
+file=`echo ${title}| tr -d ",.?!;\"'" | sed "s/\s\+$//;s/\s\+/-/g;s/./\L&/g"`.txt
test -z "$file" && exit 1