Solved

AIX 5.x set up arrow to recall

Posted on 2016-09-02
11
63 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

749 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