aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw44@gmail.com>2016-09-24 14:20:10 +0800
committerTing-Wei Lan <lantw44@gmail.com>2016-09-24 15:08:29 +0800
commit368abd78d9d34aa9e422b8bdadb0e7bd90029923 (patch)
tree90836d16661effef1e8066a7633e7c78d3600e80
parent30d00e414e7192869e64376a800e698e6a6e644f (diff)
downloadconfigfile-368abd78d9d34aa9e422b8bdadb0e7bd90029923.tar
configfile-368abd78d9d34aa9e422b8bdadb0e7bd90029923.tar.gz
configfile-368abd78d9d34aa9e422b8bdadb0e7bd90029923.tar.bz2
configfile-368abd78d9d34aa9e422b8bdadb0e7bd90029923.tar.lz
configfile-368abd78d9d34aa9e422b8bdadb0e7bd90029923.tar.xz
configfile-368abd78d9d34aa9e422b8bdadb0e7bd90029923.tar.zst
configfile-368abd78d9d34aa9e422b8bdadb0e7bd90029923.zip
bash_include: 避免在 bash 4.4 因為記憶體配置失敗而無法登入bash_include-20160924
-rw-r--r--bash_include9
1 files changed, 7 insertions, 2 deletions
diff --git a/bash_include b/bash_include
index e4609c4..252bb00 100644
--- a/bash_include
+++ b/bash_include
@@ -119,8 +119,13 @@ nocolorprompting="${nocolorprompting}"'\$ '
colorsecondprompting="\[\e[36m\]-->\[\e[m\] "
nocolorsecondprompting="--> "
-HISTSIZE=2147483647
-HISTFILESIZE=2147483647
+if [ "${BASH_VERSINFO[0]}" -gt "5" ] || [ "${BASH_VERSINFO[0]}" -eq "4" -a "${BASH_VERSINFO[1]}" -eq "3" ]; then
+ HISTSIZE=-1
+ HISTFILESIZE=-1
+else
+ HISTSIZE=2147483647
+ HISTFILESIZE=2147483647
+fi
HISTCONTROL=ignoredups:ignorespace
HISTTIMEFORMAT="%F %T "
historycountfile="$HOME/.bash_history.count"