#!/bin/bash -e UUID=$(uuidgen) printf "content: |\n ...\nauthor: ...\nid: $UUID\n" >quotes/$UUID if ! $EDITOR quotes/$UUID; then rm quotes/$UUID fi rm -f "quotes/${UUID}~"