Last active
December 9, 2017 14:22
-
-
Save dash1291/d6c74612c048ee66438c7c0f72dd28dd 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
#!/bin/bash | |
if [ -d "$NOTES_DIRECTORY" ]; then | |
filesuffix=`date "+%Y-%m-%d-%H-%M-%S"` | |
filename="note-$filesuffix.txt" | |
filepath="$NOTES_DIRECTORY"/$filename | |
if [ ! -z "$1" ]; then | |
echo "Saving note to $filepath" | |
echo "$1" > "$filepath" | |
else | |
echo "Opening editor to edit $filepath" | |
$EDITOR "$filepath" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment