monochromatic

monochromatic blog: http://blog.z3bra.org
git clone git://z3bra.org/monochromatic
Log | Files | Refs

commit f4e94709b37a9edfb1d118a8f916fd4794a46c2f
parent 76dad7929494c281aba0eef7d50b84f5beffae00
Author: z3bra <willyatmailoodotorg>
Date:   Mon, 21 Dec 2015 13:06:27 +0000

Make post.sh more robust against POSIX

Diffstat:
post.sh | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/post.sh b/post.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/bin/sh # Ask the user for a title read -p "Post title: " title # use post title to name the file -file=`echo ${title}| tr -d ",.?!;\"'" | sed "s/\s\+$//;s/\s\+/-/g;s/./\L&/g"`.txt +file=`echo ${title}| tr -d ",.?!;\"'" | tr -s ' ' | tr 'A-Z ' 'a-z-' | sed "s/-*$//"`.txt test -z "$file" && exit 1