Permalink
Browse files

fix performance when logging in with lots of history files

  • Loading branch information...
1 parent 4ab2d3f commit dab74c3c784da6c9c093279af8a752cf38564e6e @gorillamania gorillamania committed Sep 30, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 .profile
View
@@ -22,12 +22,13 @@ if [ "$MAX_DAYS" != "" ] ; then
fi
# Read in history from the previous history files, up until we hit HISTSIZE
+histtemp=`mktemp /tmp/hist.XXXXXXXX`
+touch $histtemp
for file in `ls -1tr $bash_hist`; do
- history -r $bash_hist/$file
- if [ `history | wc -l` -gt $HISTSIZE ] ; then
- break
- fi
+ cat $bash_hist/$file >> $histtemp
done
+history -r $histtemp
+rm $histtemp
########### Always use vim
export SVN_EDITOR=`which vim`

0 comments on commit dab74c3

Please sign in to comment.