steigr / advanced-shell-history Goto Github PK
View Code? Open in Web Editor NEWThis project forked from englishm/advanced-shell-history
Automatically exported from code.google.com/p/advanced-shell-history
License: Apache License 2.0
This project forked from englishm/advanced-shell-history
Automatically exported from code.google.com/p/advanced-shell-history
License: Apache License 2.0
Advanced Shell History http://code.google.com/p/advanced-shell-history/ Save your command line history in a sqlite3 DB! Features of this utility: * Retains extra command details: * exit code * start and stop times (and command duration) * current working directory of the command * session details such as tty, pid, ppid, ssh connection details * works with multiple shells (zsh and bash) * saves history into a sqlite3 database * provides a convenient tool to query the history database. HOW TO BUILD: $ make build_c # Builds the C++ version $ make build_python # Builds the Python version $ make build # Builds both versions Notes: * A full build of the code from source depends on the following commands or utilities existing on your build system: - bash - make - g++ and gcc - curl - tar - unzip - sed and awk - flex (optional: only needed if rebuilding queries.cpp from queries.l) * Also recommended is sqlite3 for writing new queries interactively. * On a Mac, you will need to install xcode for make, g++: http://developer.apple.com/xcode/ HOW TO INSTALL: $ make install_c # Installs the C++ version $ make install_python # Installs the Python version $ make install # Installs both versions HOW TO UNINSTALL: $ make uninstall HOW DOES THIS WORK: This program operates on the assumption that your shell gives you the ability to execute a custom operation before a prompt is redrawn on your terminal. Bash provides the PROMPT_COMMAND environment variable while zsh gives us the precmd environment function. Both are repurposed by this program to log the previous command into a local database before each new prompt is displayed. Many people have never heard of this feature or found a great use for it. However, if you currently DO use this feature, you can still use this program. The code renames your existing hook and invokes it after saving the previous command. Caveats: * this is not meant to be a security auditing tool - it's for user convenience and meant to enhance shell builtin history. * for bash users, this overrides your PROMPT_COMMAND and changes the default options of your builtin history. Hopefully both are an improvement. * for zsh users, this overrides your precmd function. the shell script attempts to rename your previous precmd function and continue to hook into it. * all users will notice that the PIPESTATUS / pipestatus variables have been renamed to ASH_PIPESTATUS. Because these variables are transient and logged, they cannot be easily restored. Instead they are copied. * when you build this, the Makefile may download a version of sqlite3 (if it's not already included in the tarball or the svn repo). * this potentially changes your normal shell history settings to enable options necessary for the magic to work. Bugs: * doesn't capture exec'ed commands: example: exec rm /tmp/foo # is lost * the python version is about 10x slower than the C++ version Author: [email protected] (Carl Anderson) Last Update: 2012-08-06
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.