#!/usr/bin/bash files=$(find $HOME/Journal -type f -iname "*$1*\.md") if [ -z ${EDITOR} ]; then echo "EDITOR unset, defaulting to Nano" export EDITOR=nano fi $EDITOR $files