I'm trying to add a title to my brief shell script for note taking, however I am unsure how to grab the string of text after calling the script. Currently I have:
note = note() {
cd ~/Sync
date >> notes.txt
echo "----------------------------\n" >> notes.txt
cat >> notes.txt
echo "\n" >> notes.txt
}
Which works fine for adding a note with a datestamp, however I want to be able to type a short title after the word note
and output it separately.
So, in my terminal (ZSH) I want to be able to do the following:
~ note This is the title
~ This is the body text
[ctrl-d]
To produce:
Fri 14 Feb 2020 13:34:51 GMT
----------------------------
This is the title
This is the body text