monochromatic

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

commit c324148a7e8621ec00c94808b1e52ff8fd0f2f1b
parent ea5d78639c0ec73e577163083b8e0502c85e198e
Author: z3bra <willyatmailoodotorg>
Date:   Tue, 30 Aug 2016 14:13:41 +0200

post.sh: allow title passed as argument

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

diff --git a/post.sh b/post.sh @@ -1,7 +1,12 @@ #!/bin/sh # Ask the user for a title -read -p "Post title: " title +if [ $# -lt 1 ]; then + printf "Post title: " + read title +else + title="$@" +fi # use post title to name the file file=`echo ${title}| tr -d ",.?!;\"'" | tr -s ' ' | tr 'A-Z ' 'a-z-' | sed "s/-*$//"`.txt @@ -25,7 +30,6 @@ cat <<EOF > ${post} # [${title}](#) ## &mdash; ${date} -<!-- vim: set ft=markdown ts=4 et tw=80: --> EOF if ! test -f ${post}; then