Solved

AIX 5.x set up arrow to recall

Posted on 2016-09-02
11
54 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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
 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Restore XenServer VM with only dd image of LVM snapshot 3 186
check unix curl command return value 7 127
unix example issues 18 92
Install MySQL 5.6 and PHP on Centos Linux 6 125
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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…

825 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