Author |
Message
|
jeevan |
Posted: Fri Jan 27, 2006 12:22 pm Post subject: is there AIX question |
|
|
Grand Master
Joined: 12 Nov 2005 Posts: 1432
|
I am impatientionately looking for a ways to invoke previous command in AIX. I know this is not a proper forum but can someone tell me how I can do that. I tried with exc k and pressing r. but these are not userfriendly as in dos which can be invoked with up arrow. Is there a way to do that?
thanks |
|
Back to top |
|
 |
wschutz |
Posted: Fri Jan 27, 2006 12:35 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Sure, install a bash shell. _________________ -wayne |
|
Back to top |
|
 |
jeevan |
Posted: Fri Jan 27, 2006 12:42 pm Post subject: |
|
|
Grand Master
Joined: 12 Nov 2005 Posts: 1432
|
how? do I need to do whole thing? I am not an admin guy and they are very restrictive. Cannot I do that simpley manner?
thanks |
|
Back to top |
|
 |
csmith28 |
Posted: Fri Jan 27, 2006 12:47 pm Post subject: |
|
|
 Grand Master
Joined: 15 Jul 2003 Posts: 1196 Location: Arizona
|
(Move) This was not MQ Related. _________________ Yes, I am an agent of Satan but my duties are largely ceremonial. |
|
Back to top |
|
 |
wschutz |
Posted: Fri Jan 27, 2006 12:48 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
What shell are you running? (echo $SHELL) I think ksh might support arrow keys, but I'm not certain _________________ -wayne |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 27, 2006 12:48 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
KSH does not have the up-arrow set as a command for retrieving commands from history.
There are ways in unix shells to specify your own key-bindings. In ksh, particularly, you could go into emacs mode and then specify an emacs key binding to map the up arrow to the command you wanted.
But in the long run, it's probably going to be easier for you to learn the predefined key for the ksh mode you like - vi or emacs - and use that.
Because you'll have to define this custom key-binding on every ksh machine you ever use, and you'll have trouble doing normal things until you have done that. So it will save you time and effort to learn the "normal" way of doing it.
But Bash is a better shell than Ksh. So you could do some searches in Google for installing unix stuff in your home directory and then find a version of bash that might run in your home directory and try that.
But shells might need to be installed by root. In which case, you're stuck having to ask your admins. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
csmith28 |
Posted: Fri Jan 27, 2006 12:49 pm Post subject: |
|
|
 Grand Master
Joined: 15 Jul 2003 Posts: 1196 Location: Arizona
|
|
Back to top |
|
 |
csmith28 |
Posted: Fri Jan 27, 2006 12:53 pm Post subject: |
|
|
 Grand Master
Joined: 15 Jul 2003 Posts: 1196 Location: Arizona
|
jefflowrey wrote: |
KSH does not have the up-arrow set as a command for retrieving commands from history. |
True ksh does not have an up arrow but if you do the following upon login.
Code: |
# ksh
# set -o vi
# stty erase ^? |
This allows you to use the Esc-k key combination to recall the last command from your .sh_history. Continuing to type the k key moves you one command at a time backward in the .sh_history. The j will move you forward.
set -o vi lets you use vi commands to edit the command line
stty erase ^? sets the backspace key to work. _________________ Yes, I am an agent of Satan but my duties are largely ceremonial. |
|
Back to top |
|
 |
wschutz |
Posted: Fri Jan 27, 2006 12:56 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Quote: |
But in the long run, it's probably going to be easier for you to learn the predefined key for the ksh mode you like - vi or emacs - and use that |
IMHO, anyone working on a unix system should at least know the fundamentals of "vi". Its a good thing to learn  _________________ -wayne |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jan 28, 2006 11:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
And keep in mind that the bash shell might already have been installed on the machine.
see /usr/bin/bsh
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Jan 28, 2006 6:52 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
wschutz wrote: |
Quote: |
But in the long run, it's probably going to be easier for you to learn the predefined key for the ksh mode you like - vi or emacs - and use that |
IMHO, anyone working on a unix system should at least know the fundamentals of "vi". Its a good thing to learn  |
Well.
At least, in most cases, it's easier than emacs. In My, well, not so humble, opinion. But on the other hand, I know that emacs has mechanisms for setting key-bindings, and I haven't gone that deep into vi.
I can do what I need to do with Vi, and everything else is solved by X-windows or sftp.....  _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
csmith28 |
Posted: Sat Jan 28, 2006 7:16 pm Post subject: |
|
|
 Grand Master
Joined: 15 Jul 2003 Posts: 1196 Location: Arizona
|
wschutz wrote: |
Quote: |
But in the long run, it's probably going to be easier for you to learn the predefined key for the ksh mode you like - vi or emacs - and use that |
IMHO, anyone working on a unix system should at least know the fundamentals of "vi". Its a good thing to learn  |
+1
vi is native to almost if not all Unix Operating Systems. One you know vi you really don't need to know any other Unix editor. _________________ Yes, I am an agent of Satan but my duties are largely ceremonial. |
|
Back to top |
|
 |
|