Created
October 2, 2017 21:06
-
-
Save NorikDavtian/e465e7e8df194d43d0a14c7964acf262 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add this function to your bash profile, in my case ~/.zshrc | |
# FROM: https://dev.to/ricardomol/note-taking-from-the-command-line-156 | |
# Examples: | |
# | |
# notes <<NOTE | |
# This is a very long note | |
# because sometimes I like | |
# to write explanations of | |
# my commands and such. | |
# NOTE | |
# | |
# Example 2: | |
# notes my_command -which -I -want -to remember | |
notes() { | |
if [ ! -z "$1" ]; then | |
# Using the "$@" here will take all parameters passed into | |
# this function so we can place everything into our file. | |
echo "$@" >> "$HOME/notes.md" | |
else | |
# If no arguments were passed we will take stdin and place | |
# it into our notes instead. | |
cat - >> "$HOME/notes.md" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment