Solved

AIX 5.x set up arrow to recall

Posted on 2016-09-02
11
41 Views
Last Modified: 2016-09-02
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
Comment
Question by:D T
  • 6
  • 5
11 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 41781732
Add "set -o emacs" to your ~/.profile.
0
 

Author Comment

by:D T
ID: 41781735
So, I will have to do that for every profile? Is there any other way to have that set via global?
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 500 total points
ID: 41781764
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
 

Author Comment

by:D T
ID: 41781789
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
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 500 total points
ID: 41781807
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:D T
ID: 41781810
I see that emacs is off and vi is on.
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 500 total points
ID: 41781817
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
 

Author Comment

by:D T
ID: 41781831
Neither of them have "set -o vi". Please see attached
profile---etc.txt
profile.txt
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 41781843
"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
 

Author Comment

by:D T
ID: 41782001
It worked!!! :D
0
 

Author Closing Comment

by:D T
ID: 41782007
Thank you very much!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now