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