DEV Community

Discussion on: Simple note taking from the command line

Collapse
 
ricardomol profile image
Ricardo Molina

Hi Jonathan, I just tried your code and I was suprised to find that when I call the notescommand without parameters, it doesn't show the content of the notes.md file. Instead it expects me to introduce the note content itself, and it doesn't write it to file till I do Ctrl + C. Hmm... I'll find out how to fix this.

Collapse
 
michaelmior profile image
Michael Mior

That looks like it's the intended behaviour to make it easy to write multi-line notes. If you'd rather have it just show the notes, then change the second branch of the if statement to just cat "$HOME/notes.md.

Thread Thread
 
ricardomol profile image
Ricardo Molina

You are absolutely right Michael. I misread the comment and thought that, in absence of paramenters, the expected behavior was to display the file content. My apologies for the mistake Jonathan.