Simple bash script to write short notes to Markdown files from the command line. Write notes on a single line or use stdin to pass longer multiline notes.
Writes to a default notes.md
file but the file to write to can be specified.
Usage:
notes [-h] [-f filename] text to write to notes file
-h Display help text
-f filename filename to write notes to in ~/Documents/notes folder ( default: notes.md )
Single line note into sample.md
notes -f sample.md the note I want to write
pipe this function's help text into notes.md
notes -h | notes
Multiline example into default file
notes<<NOTE
>this is a longer multiline note
>following heredoc syntax
>This example writes to the default file (notes.md)
>NOTE
Multiline example with filename specified
notes -f specific_file.md<<NOTE
>this is a longer multiline note
>following heredoc syntax
>This example writes to specific_file.md
>as the -f flag has been passed.
>NOTE
Clone the project to a .bash
folder in your home directory:
mkdir ~/.bash
cd ~/.bash
git clone git://github.com/colmose/notes.git
Edit your ~/.bash_profile
or ~/.profile
or ~/.bashrc
(for Ubuntu) and add the following to the top:
export GITAWAREPROMPT=~/.bash/notes
source "${GITAWAREPROMPT}/notes.sh"