aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-02-19 10:34:11 +1300
committerTom Ryder <tom@sanctum.geek.nz>2014-02-19 10:34:11 +1300
commit039fed817e54e0afca219839ea421424bd5947a2 (patch)
tree3ecbd4f32609fbb7195afb32742d09d5c57ae03b /bash/bashrc
parentNo longer needed due to curlrc (diff)
downloaddotfiles-039fed817e54e0afca219839ea421424bd5947a2.tar.gz
dotfiles-039fed817e54e0afca219839ea421424bd5947a2.zip
Simplify/clarify history settings
Testing BASH_VERSINFO like this is really ugly, and not really worth the convenience of infinite history in the upcoming Bash 4.3. There's also little advantage in me having such huge amounts of history in memory for each instance of my interactive shell; I've never even approached a million lines of history on any of my machines. This should be more than enough. Clarified the differences between the variables a bit too.
Diffstat (limited to 'bash/bashrc')
-rw-r--r--bash/bashrc14
1 files changed, 5 insertions, 9 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 09edf801..defda393 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -11,15 +11,11 @@ if [[ $- != *i* ]] ; then
return
fi
-# Keep plenty of history; unlimited, if we have >=4.3
-if ((${BASH_VERSINFO[0]} >= 4 \
-&& 10#${BASH_VERSINFO[1]%%[![:digit:]]*} >= 3)) ; then
- HISTFILESIZE=-1
- HISTSIZE=-1
-else
- HISTFILESIZE=1000000
- HISTSIZE=1000000
-fi
+# Keep around a million lines of history in file
+HISTFILESIZE=$((2 ** 20))
+
+# Keep around a thousand lines of history in memory
+HISTSIZE=$((2 ** 10))
# Ignore duplicate commands and whitespace in history
HISTCONTROL=ignoreboth