K.Mandla's blog of Linux experiences

jn, a journal notebook tool

I have a relative “newcomer” application to share with you today. I mentioned a few times that I knew about a journal application that existed, but didn’t have permission to share it. I do now, so … here’s jn:

Ben Winston has come up with a very simple, very straightforward bash-driven tool that concatenates a journal file with an entry. No fancy gimmicks or wild-and-crazy triple-function Swiss-army knives.

Unix-ish is a good word for it. You can add to your journal with the editor of your choice, and you view your existing journal with less, the omnipresent pager application.

The “installer” — which really just adds a line or so to your .bashrc file for ease of startup — is adjustable on several points, so you can change the location and name of your journal, if you want.

And beyond that, it relies only on bash and your editor and the amount of space you have available on your drive. How you use the results, and how you arrange your diary are up to you.

Ben said he’s been looking for input on this, and if you have ideas or would like to help him improve it, his contact information is in the tarball.

And I know that in the midst of this holiday season, you have lots and lots of time on your hands. Don’t you? :D

It seams that for some reason the application is not able to write to /tmp/. Is anyone getting the same problem? i dont wanna contact the author before being certain it is not some dummy error of mine…

I followed the instaructions on the README and sourced the bashrc. I reinstaled it (deleting ~/.journal, restoring ~/.bashrc and re-running jninstaller) and resourced the bashrc before executing any jn command but i still get the same behaviour. Maybe something messy with my bashrc? i can provide the file if needed.

This looks like it will be useful. I only have minor feedback. This line:
echo -e “$(date +%A) $(date +%B) $(date +%d), $(date +%Y) at $(date +%r):\n” >> $journal
can be changed to:
date ‘+%A %B %d, %Y at %r:’$’\n’ >> $journal

and in the jninstaller, the section that sets the preferred editor can be set to use the $EDITOR variable, if set:
#ask which editor to use when updating journal
if [[ -z $EDITOR ]]; then
echo -ne “Preferred Editor: ”
read jneditor
else
jneditor=$EDITOR
fi

So if someone already has $EDITOR set, jninstaller will just use that and only ask for an editor if $EDITOR isn’t set.

Thanks so much for the feedback! As you could probably tell from the script, I’m a newcomer to bash :)

As for tying it in to the $EDITOR variable, I wasn’t sure if people would prefer updating a journal in something different than they normally edit config files with. Maybe having it default to $EDITOR and asking if they want that to be it or not? I don’t know, but it’s something to play around with.

There’s probably as many ways to do this as there are people who want to type notes at the command line. I have something similar to what you posted in the pastebin and might use a combination of jn my note function.

This is a really nice little script (program?). Seeing as it write to a simple text file, you could easily make a cron job to have it copy to a web directory, and have an incredibly simple online blog.

The only thing I could see to change is a slight typo in the text that comes up when you run it with an unknown arguement (jn -unknown). It reads,