my daily command
As part of personal and professional life, I find it helpful to have a quick way to dive in and out
of my daily plan. This little shell function has served me well over the years, providing a simple format
to arrange the day’s thoughts just by typing daily
in my shell.
Drop the following snippet in your .bashrc
or .zshrc
or even better setup a .shellfuncs
and source
that from those
files instead.
daily() {
noteroot="$HOME/org/notes/"
ym=`date "+%Y/%m"`
notedate=`date "+%Y%m%d"`
notepath="${noteroot}${ym}"
notefile="${notedate}.txt"
weekstart=$1
if [ ! -d "${notepath}" ]; then
mkdir -p "${notepath}"
fi
if [ ! -e "${notepath}/${notefile}" ]; then
touch "${notepath}/${hotefile}"
if [ "${weekstart}" != "" ]; then
echo "Friday:\n\n\nToday:\n\n\nBlockers:" >> "${notepath}/${notefile}"
else
echo "Yesterday:\n\n\nToday:\n\n\nBlockers:" >> "${notepath}/${notefile}"
fi
fi
pushd $notepath > /dev/null
$EDITOR "${notepath}/${notefile}"
popd > /dev/null
}
You’ll get a standard layout in a consisently named path that looks like this:
Fill it out with your plan, call daily
throughout the day for updates and easily review previous days
to jog your memory on what exactly it was that you did last Thursday.
Read other posts