• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 136
  • Last Modified:

AIX 5.x set up arrow to recall

Hi,

I have seen many posts about using
"set -o emacs

alias __A=`echo "\020"`   # up arrow = ^p = previous
alias __B=`echo "\016"`   # down arrow = ^n = next
alias __C=`echo "\006"`   # right arrow = ^f = cursor formard
alias __D=`echo "\002"`   # left arrow = ^b = cursor backwards
alias __H=`echo "\001"`   # home = ^a = cursor at start of line
"

which works for me in the .profile but not as a global (/etc/profile).
My /etc/profile does not have "set -o vi" in it.


When I run 'alias' command, i see when using the global /etc/profile:
"__A=
__B=
__C=
__D=
"

If I decide to type "set -o emac" in my command line, the arrows work. Is there a way to fix this for me to just login without having to type set -o emac while using the global instead of .profile?
0
D T
Asked:
D T
  • 6
  • 5
4 Solutions
 
woolmilkporcCommented:
Add "set -o emacs" to your ~/.profile.
0
 
D TAuthor Commented:
So, I will have to do that for every profile? Is there any other way to have that set via global?
0
 
woolmilkporcCommented:
So add it to/etc/profile!

If there are users running under a shell other than ksh we can add some logic to determine the actual shell.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
D TAuthor Commented:
I have added it to /etc/profile. I have "

set -o emacs

alias __A=`echo "\020"`   # up arrow = ^p = previous
alias __B=`echo "\016"`   # down arrow = ^n = next
alias __C=`echo "\006"`   # right arrow = ^f = cursor formard
alias __D=`echo "\002"`   # left arrow = ^b = cursor backwards
alias __H=`echo "\001"`   # home = ^a = cursor at start of line
"
in that file, of course without the ("").

I have re logged and even restarted the server. It works when i type set -o emacs in the command line.
0
 
woolmilkporcCommented:
This must work!

Please issue after a fresh login and before running any other command:

set -o

What do you see next to "emacs" and "vi"?
0
 
D TAuthor Commented:
I see that emacs is off and vi is on.
0
 
woolmilkporcCommented:
So scan /etc/profile, ~/.profile and whatever initialization files you have for "set-o vi'!

"vi" doesn't go "on" without the corresponding "set" command being issued from somewhere!
0
 
D TAuthor Commented:
Neither of them have "set -o vi". Please see attached
profile---etc.txt
profile.txt
0
 
woolmilkporcCommented:
"EDITOR=vi" resets the "emacs" option and sets "vi"!

Setting "EDITOR" must precede "set -o emacs"!

So add "export EDITOR=vi" to /etc/profile before "set -o emacs" and remove that statement from .profile!
1
 
D TAuthor Commented:
It worked!!! :D
0
 
D TAuthor Commented:
Thank you very much!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now