make renaming script better

This commit is contained in:
raspbeguy 2020-05-13 09:50:49 +02:00
parent 5947ace2e4
commit 7993779c25
1 changed files with 1 additions and 1 deletions

View File

@ -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