setting options in bash

Kevin Buettner kev@primenet.com
Wed, 3 May 2000 18:23:29 -0700


On May 1,  7:51am, Gorman, John wrote:

> Also set it in your .bash_profile

I haven't looked at the precise reasons why, but for some reason,
the line

    INPUTRC=/etc/inputrc

in /etc/profile prevents "set -o vi" from working when placed in
either .bashrc or .bash_profile.

Not all distributions do this; Red Hat does, but TurboLinux does
not.  (Those are the only ones I have installed at the moment.)

Putting "set editing-mode vi" in your ~/.inputrc file is really a
better solution than "set -o vi" (in either .bash_profile or .bashrc)
because then vi command line editing will work in other tools which
use the readline library.  E.g, if you use the command line version of
gdb, you'll find that the history mechanism and line editing
mechanisms will be set to vi bindings just as they are in bash (when
you use this setting).

I've just noticed that python seems to use the readline library.
Perl can be enabled to use readline as well if you install the
Term::ReadLine and Term::ReadKey modules.

Kevin

-- 
Kevin Buettner
kev@primenet.com, kevinb@redhat.com