Often, I want to note down something really quicky when working in the terminal - Something to do, something interesting, etc. So I thought I'd include this function in my .bashrc
:
export QUICKY="$HOME/Documents/Notes/quickies"
quicky(){
if (( $# == 0 )) ; then
vim $QUICKY
return
fi
for i in $@; do
echo "$i" >> $QUICKY
done
}
So this is really simple. A use case would be something like quicky meeting
to quicky note about a meeting or something similar. I would just do quicky
to read the notes and further organize if I wanted.
Suppose I do something like quicky "Feed the dog"
, I expect a new line feed the dog
in $QUICKY, but every word appears in a new line. How can I tackle this issue?
PS. quicky "!!" would be excellent to quicky note down interesting commands that you want to read about later.
Although suggestions and answers about any other ready-made tools are alright, I would like to know how I'd do this with bash.
echo "$@" >> $QUICKY
will do; no need to loop. – Jun 15 '20 at 10:05quicky "feed the dog" "go to meeting"
should have the two args on two different lines. Is that too difficult to understand? – Suraaj K S Jun 16 '20 at 11:06