[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
A lesson learned...
I'm not a very good at bash scripting, so when I get something right I
try to re-use it as often as I can. Case in point: /etc/bashrc. I've
crafted a custom PS1 prompt and some aliases and environmental settings
that suit my needs well.
After installing RHEL4 yesterday, I mounted my RHEL3 root filesystem
(see note below) and copied over the old customized /etc/bashrc. Before
copying the old bashrc over, I'd saved the new one to bashrc.original
(thank goodness). All of a sudden I started having problems with vi(m)
in Gnome terminals. The backspace key produced a ^? instead of
backspacing over the previous character.
I searched through my e-mail archives looking for a thread about this
problem (which I had initiated) in the FC3 mail list. The problem was
traced to added code in an early FC3 bashrc that had to do with handling
the erase function in interactive shells. Apparently this new code
caused problems because it disappeared in later bashrc upgrades. I
discovered this a few minutes ago when I found and examined a much
simpler bashrc.rpmsave file on my FC3 laptop which turns out to be the
same one used by the new RHEL4. It hadn't dawned on me to check it out
back then. Laziness, to be sure. Had I done so, I wouldn't be writing
this.
After ditching the carryover /etc/bashrc and creating a new one by
adding my custom PS1 and aliases to /etc/bashrc.original, vi(m) in RHEL4
now behaves normally with its default settings.
I could have "fixed" the problem by changing the current profile's
compatibility settings in Gnome-terminal for the backspace key from
ASCII DEL to Control-H. That really did make vi(m)'s backspace work
properly. But the underlying problem in /etc/bashrc was still there, so
all I had really done was compound that with a second one.
Note: Before installing any new version of FC or RHEL, I use dd
to save mountable images of the current OS to a large drive.
That way I can install the new OS "from scratch" with no upgrade
problems, or do a total bare metal restoration if I encounter
something fatal. After installing the new version, I just mount
the old image and copy over the files I've customized. Today I
learned -- the hard way, naturally -- that this is not
necessarily the best way to carry over those custom settings.
-- Doc
Robert G. (Doc) Savage, BSE(EE), CISSP, RHCE | Fairview Heights, IL
RHEL4/ES on Tyan S2468UGN w/3G, dual Athlon MP 2800+, 1.1T RAID5
"Perfection is the enemy of good enough."
-- Admiral of the Fleet Sergei G. Gorshkov
-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.