From 7993779c25aca59f30eadd62670a42e42f859db8 Mon Sep 17 00:00:00 2001 From: raspbeguy Date: Wed, 13 May 2020 09:50:49 +0200 Subject: [PATCH] make renaming script better --- rename_posts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rename_posts.sh b/rename_posts.sh index 90f74df..9f5b660 100755 --- a/rename_posts.sh +++ b/rename_posts.sh @@ -7,5 +7,5 @@ for post in * do title=`sed -n 's/^title: "\?\(.*\)"\?$/\1/p' $post` safename=`echo $title | iconv -t ascii//TRANSLIT | tr '[:upper:]' '[:lower:]' | tr -s '[:punct:] ' '-' | sed 's/-*$//g;s/^-*//g'` - mv $post $safename.md + mv -v $post $safename.md 2> /dev/null done