The functions as described in the article are so:
1 2 3
Unfortunately, the second function – for retrieving the list of files in
the notes directory has two significant shortcomings — it uses
and it will only list files in the top level directory. If you are an
inverterate note taker, this plainly won’t scale.
My first attempt at hacking a solution yielded this little beauty:
ls from the function and allows nested directories, but
is needlessly complex and, with four pipes, hideously
After reading up on Awk, particularly Bruce Barnett’s primer, I arrived at something marginally longer but relying solely on the awesome power of awk to make the various transformations I was seeking…
An added advantage is that it is scalable irrespective of how deep the directories go. I’m sure that with some more awk-foo I could write a more effective set of conditionals, but this seemed a pretty good start for a simple note taking utility.
To remove a little of the visual clutter, I amended the awk script to
.txt extensions from the output.2
And if you really want this to work well, create your .notes directory in a dropbox folder and symlink to it from ~/.notes.
Obligatory “after” screenshot: