Hello, I have a bunch of notes I've been keeping in notecase over the
years, but there's no easy way to access them from the commandline.
So, I wrote a quick script to pull them out...is anyone else interested?
It's just a shell script, it kinda grew organically as I needed it.
https://github.com/taviso/ncpro
It looks like this:
$ ncpro help
usage: ncpro [-d database] CMD [PARAMS...]
CMD can be one of:
list - list child notes
print - print note contents
show - alias for print
edit - open editor and change note
find - find notes with matching string
markdown - set all notes without syntax to markdown
(where database is a .ncdb file)
$ ncpro list
• /Linux - 33
• /Windows - 19
And you can drill down into deeper levels:
$ ncpro list /Linux
• /Linux/apt
• /Linux/awk
...
And then print the article you want:
$ ncpro print /Linux/awk
/Linux/awk
Print lines between a pattern
awk '/start/,/end/'
Sort lines by length
awk '{ print length, $0 }' | sort -g
...
You can even edit a note with $EDITOR:
$ ncpro edit /Linux/awk
Will open it in vim.
I haven't managed to break a note yet, but it's pretty hacky, and I'm sure
Miroslav is horrified :)
Tavis.
--
_o) $ lynx
lock.cmpxchg8b.com
/\\ _o) _o) $ finger
tav...@sdf.org
_\_V _( ) _( ) @taviso