From 1b98e39f5affe773ac12f0414258085a6c7c6e65 Mon Sep 17 00:00:00 2001 From: Levent YALCIN Date: Fri, 4 Nov 2016 18:14:45 +0000 Subject: [PATCH 1/2] ignorespace is a good one other than shopt --- lib/history.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/history.bash b/lib/history.bash index f7d3303c..cfc58963 100644 --- a/lib/history.bash +++ b/lib/history.bash @@ -3,7 +3,7 @@ # Bash History Handling shopt -s histappend # append to bash_history if Terminal.app quits -export HISTCONTROL=${HISTCONTROL:-erasedups} # erase duplicates; alternative option: export HISTCONTROL=ignoredups +export HISTCONTROL=${HISTCONTROL:-ignorespace:erasedups} # erase duplicates; alternative option: export HISTCONTROL=ignoredups export HISTSIZE=${HISTSIZE:-5000} # resize history size export AUTOFEATURE=${AUTOFEATURE:-true autotest} # Cucumber / Autotest integration From e1f4283b6444f87bdc20600520be4569b6cd224b Mon Sep 17 00:00:00 2001 From: Levent YALCIN Date: Fri, 4 Nov 2016 18:15:07 +0000 Subject: [PATCH 2/2] indentation fix --- lib/history.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/history.bash b/lib/history.bash index cfc58963..a1a7cb04 100644 --- a/lib/history.bash +++ b/lib/history.bash @@ -2,10 +2,10 @@ # Bash History Handling -shopt -s histappend # append to bash_history if Terminal.app quits +shopt -s histappend # append to bash_history if Terminal.app quits export HISTCONTROL=${HISTCONTROL:-ignorespace:erasedups} # erase duplicates; alternative option: export HISTCONTROL=ignoredups -export HISTSIZE=${HISTSIZE:-5000} # resize history size -export AUTOFEATURE=${AUTOFEATURE:-true autotest} # Cucumber / Autotest integration +export HISTSIZE=${HISTSIZE:-5000} # resize history size +export AUTOFEATURE=${AUTOFEATURE:-true autotest} # Cucumber / Autotest integration function rh { history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head