Store and query bash
history in an sqlite3 database following Advanced Shell History schema using only bash
and sqlite3
(and fzf
).
$ source shist.sh
$ shist-<TAB> $ shist-cwd 25|2019-06-01 07:44:01|cd shist/|0|0 25|2019-06-01 07:51:21|less shist.sh|0|49 $ shist-here (fzf opens)
- Set location of
SHIST_DB
at top. - Write new or modify existing
shist-*
query+format functions.
Do you use vcsh? Of course you do. Wanna add shist
to your setup but
keep connection to this repo? Who wouldn’t? Assuming $HOME/.bash/
is
already under vcsh
control as module “bash”, one might do something
like:
$ mkdir ~/.bash/subrees $ vcsh bash remote add shist https://github.com/brettviren/shist.git $ vcsh bash fetch shist $ vcsh bash subtree add -P .bash/subtrees/shist -m "shist subtree" shist/master (hack) $ vcsh bash subtree push -P .bash/subtrees/shist shist master
Then:
source $HOME/.bash/subtrees/shist/shist.sh