1 # If not running interactively, don't do anything
2 [ -z "$PS1" ] && return
3
4 # don't put duplicate lines in the history. See bash(1) for more options
5 # don't overwrite GNU Midnight Commander's setting of `ignorespace'.
6 export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
7 # ... or force ignoredups and ignorespace
8 export HISTCONTROL=ignoreboth
9
10 # append to the history file, don't overwrite it
11 shopt -s histappend