My New Post Bash Shell Script

May 17, 2020

jigsaw bash

I like to make shell scripts to make my life easier. this is my current newPost script. It isnt very comlicated, but gives me a simple blank post, quickly.

I would like it to format the $something in camel case with the dashs removed by spaces.

Also, I could add a line to open it in sublime

#!/bin/bash

echo -n "New File Name:"
read something

echo "You Entered: $something"

FILE="source/_posts/$(date +%F)-$something.md"

touch $FILE

cat > $FILE << EOF
---
extends: _layouts.post
section: content
title: $something
date: $(date +%F)
description: 
cover_image: 
excerpt: 
categories: []
---
EOF


If you would like to contact me with this form on londinium.com, ilminster.net or via Twitter @andylondon