aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-10-13 16:43:33 +1300
committerTom Ryder <tom@sanctum.geek.nz>2014-10-13 16:43:33 +1300
commitf83c4aee2e2cb286e9e2fcb601b222f2132e321d (patch)
treed398ff02f83233db64e1a22098437876258542f7 /bash/bashrc
parentSeparate .vimrc and .gvimrc Makefile targets (diff)
downloaddotfiles-f83c4aee2e2cb286e9e2fcb601b222f2132e321d.tar.gz
dotfiles-f83c4aee2e2cb286e9e2fcb601b222f2132e321d.zip
Switch HISTFILESIZE for Bash >= 4.3 versions
Diffstat (limited to 'bash/bashrc')
-rw-r--r--bash/bashrc10
1 files changed, 8 insertions, 2 deletions
diff --git a/bash/bashrc b/bash/bashrc
index af509614..45837f6b 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -8,8 +8,14 @@ if [[ $- != *i* ]] ; then
return
fi
-# Keep around a million lines of history in file
-HISTFILESIZE=$((2 ** 20))
+# If Bash >= 4.3, keep all history in file forever
+if ((BASH_VERSINFO[0] >= 4 && BASH_VERSINFO[1] >= 3)) ; then
+ HISTFILESIZE=-1
+
+# Otherwise, just keep a lot (a million lines)
+else
+ HISTFILESIZE=$((2 ** 20))
+fi
# Keep around a thousand lines of history in memory
HISTSIZE=$((2 ** 10))