Posts Tagged ‘Bash’

September 14th, 2007

Keeping bash history in sync on disk and between multiple terminals (7)

Tags: ,

I rely on my ~/.bash_history extensively to avoid retyping things, both short-term and long term (when I want to look up something I typed yesterday or last week).
First, an obvious necessity is
shopt -s histappend
in ~/.bashrc, so that bash just keeps on adding to the end of the ~/.bash_history file rather than obliterate the […]

August 1st, 2007

eselect (3)

Tags: ,

Works:
eselect bashcomp enable –global ri
Silently fails:
eselect bashcomp enable ri –global
Reason: (/usr/share/eselect/modules/bashcomp.eselect)
do_enable() {
#…snip…
if [[ ${1} == “–global” ]] ; then
bcdir=”${ROOT}/etc/bash_completion.d”
shift
fi
#…snip…
# ignore any unrecognized options
[[ ${bc} == –* ]] && continue
Always looks for –global as the first parameter, apparently. Bug? Not sure. This would be the second eselect-related bug I’ve noticed in the past […]

July 1st, 2007

HISTIGNORE (1)

Tags: ,

HISTIGNORE is a handy bash option. You can specify certain strings that you want bash to ignore when storing command line history in ~/.bash_history. For those using sudo, you could automatically prevent bash from saving any of your run-as-root commands in your history. Or you can prevent it from storing exit or […]

May 5th, 2007

Darn you, failglob (2)

Tags: ,

I turned on bash_completition today. Couldn’t quite remember why I had it turned off. I quickly realized though. bash would fail on any filename with a square-bracket in it. It looks something like this:
~ $ touch ‘test [1]’
~ $ ls<I HIT TAB HERE> bash: no match: test [1]
~ $
In other words, […]