こんな感じでできるらしい。これは、noteディレクトリのファイルをMouで開くというスクリプト。(サブコマンドにopenとつけたら、エラーになったので、仮にupとしている)。
readonly NOTES_DIR="$HOME/note" readonly EDITOR_COMMAND="open -a Mou" new() { local filename="${1?:need file name}" file=`date '+%Y%m%d'`_${filename}.md cd $NOTES_DIR touch ${file} `$EDITOR_COMMAND ${file}` } view() { cd $NOTES_DIR open . } "$@"