by LinuxBender · 4y ago · 0 comments
# 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.