3 ms·
I use a shell function I found somewhere. It might have been linked here, I can't remember. This is probably only useful for people that spend a lot of time
by LinuxBender 4y ago
I use a shell function I found somewhere. It might have been linked here, I can't remember. This is probably only useful for people that spend a lot of time in a shell. One could adjust the text formatting and date format to their preference.
# cat /etc/profile.d/notes.sh
function notes()
{
if [ ! -z "$1" ]; then
mkdir --mode=00750 -p ~/.notes
Now=$(date '+%Y%m%d.%H%M.%S')
echo -en "\n$Now\t$@\n\n" >> ~/.notes/notes.txt
else
echo "${Now}"
cat ~/.notes/notes.txt 2>/dev/null
fi
}
For syncing I suppose this could be pushed to a cifs/nfs/sshfs share, or into a git repo or emailed.
Usage: notes some text -or- notes "some text that needs to be quoted in a shell;/;-)" then "notes" by itself to read all the notes. I suppose a function to null out the notes.txt file would be handy and maybe a function to commit the notes to a repo.
- dr_kiszonka 4y agoAnd I guess you could have a grep/regex function for filtering :)
- LinuxBender 4y agoGood idea. There could be categories or priorities.
- belkarx 4y agoI have something extremely similar (https://gist.github.com/belkarx/f3af7c1176ade27107330fa09c84f271 https://gist.github.com/belkarx/f3af7c1176ade27107330fa09c84...)