1823369 Members
2962 Online
109654 Solutions
New Discussion юеВ

KSH Command completion

 
SOLVED
Go to solution
Karthik S S
Honored Contributor

KSH Command completion

Hi,

I always use ksh on my hp-ux box and I love the command completion future of it ( Pressing - Esc Esc ) ... Now that we received a new Solaris box in our office but I found that "Esc Esc" doesn't work with Solaris .. Am I missing something?? Pl. let me know ...

Thanks
Karthik
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
11 REPLIES 11
Jarle Bjorgeengen
Trusted Contributor

Re: KSH Command completion

Are you sure you use ksh, and not bash or something.

Have you tried tab ?

RGds Jarle

Karthik S S
Honored Contributor

Re: KSH Command completion

I am sure that I am using "ksh" ... tab does not work with ksh ...

For instance when I do a " ls A 'Esc =' " , it lists the files in the current directory that starts with Character "A" ... but when I press Esc Esc it doesnt complete the line ...

Karthik
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Karthik S S
Honored Contributor

Re: KSH Command completion

Hi,

I got the answer from the following site,
http://www.sunhelp.org/article-ksh.php

Pressing " Esc \ " completes the line ..

Thanks
Karthik
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
John Meissner
Esteemed Contributor

Re: KSH Command completion

are you refering to command history?

if so try 'escape k'

as for command completion ... like bash for linux (?) I didn't know that ksh had this feature
All paths lead to destiny
Umapathy S
Honored Contributor
Solution

Re: KSH Command completion

hi Karthik,
try doing

$set -o vi
or
$set -o emacs

for command completion. In HPUX , set -o vi itself has the command completion. I am not sure with solaris. But set -o emacs will do a command completion with Esc Esc.

HTH
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Geoff Wild
Honored Contributor

Re: KSH Command completion

You don't need to use the Korn shell - just use the default of HP-UX - which is Posix - which is a Superset of Korn.

See this post for more:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x892a06350fe2d61190050090279cd0f9,00.html

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Karthik S S
Honored Contributor

Re: KSH Command completion

Hi Umapathy,

When I do set -o emacs in solaris Esc Esc works .... !!! But, sadly when I press "Esc v" it doesnt openup the editor .. but whereas when I do " set -o vi ' .. it works ..

Anyway I dont want to disturb HP forums with lots of Sun Stuff ....

Thanks
Karthik
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Andrew Cowan
Honored Contributor

Re: KSH Command completion

If you are using "set -o vi" and enter a command such as:

ls -l *week*

Pressing * will expand the wildcards:

ls -l myweek2 myweek2.....

BTW. Just to be pedantic there is no such thing as the Korn Shell anymore, it is now the Posix Shell.
Umapathy S
Honored Contributor

Re: KSH Command completion

hi Karthik,
Esc Esc is a feature of emacs. So when its set in the shell it works in emacs way. For previous commands you can try Ctrl+P and Ctrl+N.

If you want vi command line options, then the corresponding is Esc \.
You can also get a possible command completion list by using Esc = on the last character.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Kevin Wright
Honored Contributor

Re: KSH Command completion

to set command line editing and completion
ksh -o vi
ksh -o emacs

ksh -o to see all options


I always use -o vi and in both Solaris and HP. It's really just a mapping of you keyboard though.
Bill Douglass
Esteemed Contributor

Re: KSH Command completion

And because there are twenty ways of doing something in Unix:


export EDITOR=vi

works as well.