Created
August 27, 2020 02:17
-
-
Save muryoimpl/2a8c9a94047a3d3ce35263fd1943a0ea to your computer and use it in GitHub Desktop.
Mega 管理下のディレクトリに yyyymmdd.md を作成するスクリプト。既にあればそれを vim で開く
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
today=$(date "+%Y%m%d") | |
year=$(date "+%Y") | |
basedir=~/local/MEGAsync/memo | |
mkdir -p $basedir/$year | |
if [[ ! -e $basedir/$year/$today.md ]]; then | |
cat - << EOS > "$basedir/$year/$today.md" | |
# $today | |
EOS | |
fi | |
vim $basedir/$year/$today.md |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
vim
は$EDITOR
でいいんだろうけど、これは vim で開きたいのでvim
って書いてある。