preexec_invoke_exec () {
[ -n "$COMP_LINE" ] && return # do nothing if completing
[ "$BASH_COMMAND" = "$PROMPT_COMMAND" ] && return # don't cause a preexec for $PROMPT_COMMAND
local this_command=`HISTTIMEFORMAT= history 1 | sed -e "s/^[ ]*[0-9]*[ ]*//"`;
if [ "shopt -u extdebug" == "$this_command" ]; then
return 0
fi
eval $this_command
if [ ! -z "$this_command" ];
then
log="$(whoami),$(date +%s),$(pwd),$this_command"
#printf "$(whoami),$(date +%s),$(pwd),$this_command,\n" >> ~/.historyplus
echo "$log" >> ~/.historyplus
fi
return 1 # This prevent executing of original command
}
trap 'preexec_invoke_exec' DEBUG
-
Notifications
You must be signed in to change notification settings - Fork 0
License
boujeebit/historyplus
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published