Hi Everyone.
Long time since I posted... I have an odd issue that I am running into. My objective is to insert the following lines at the end of /etc/inputrc on an RHES box:
Code:
# alternate mappings for "page up" and "page down" to search the history
"\e[5~": history-search-backward
"\e[6~": history-search-forward
I would like this sed snippet to be portable and thus far it's worked. However, I ran into one box where after I ran the snippet, Subsequent sessions lost the ability to use the letter "e".
The original version I was using looked like this:
Code:
mv /etc/inputrc /tmp/inputrc.orig
sed 's/'\$endif'/\
# alternate mappings for "page up" and "page down" to search the history \
"\e[5~": history-search-backward \
"\e[6~": history-search-forward \
&/' /tmp/inputrc.orig > /etc/inputrc
Then instead of using s/ I thought perhaps i/ would be better so I re-did it as:
Code:
mv /etc/inputrc /tmp/inputrc.orig
sed '/'\$endif'/ {
i\
i\
# alternate mappings for "page up" and "page down" to search the history
i\
"\e[5~": history-search-backward
i\
"\e[6~": history-search-forward
}' /tmp/inputrc.orig > /etc/inputrc
Both of these produce the expected result BUT they both resulted in the loss of the letter "e".
As I mentioned earlier in the post, this was working on 'newer' RHES 5 and up but I have the misfortune of having to support some older RHES 4 boxes in a closed lab. This particular box is an RHES 4u6.
Anyone got any suggestion on how I find out what's happening? Also if some wiser sed heads can give me a more elegant version it would be appreciated.
Thanks in Advance!
Michael E