Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Korn command completion 2

Status
Not open for further replies.

Truusvlugindewind

Programmer
Jun 5, 2002
350
NL
Greetings,

At work I use HP/UX and AIX. At home I use linux.
I really like the linux bash-shell but during daytime I accepted the fact that "proffesional" unices mostly use the korn-shell.

You might understand that I get confused from time-to-time with my key-strokes. Especially "command completion" is different on the 3 platforms. As far as I can judge (based upon Q6 of HP/UX works standard and AIX has a "non standard" approach. That's why I use this forum.

Is there a way to force AIX-korn to use the 'Esc Esc' seqeunce instead of 'Esc backslash' for command completion?

Even better! use the tab key, like linux-bash. I would really like to synchonize the keystrokes.


N.B.
-1: installing bash on AIX and HP is not an option
-2: I know, I could use the ksh on linux too
-3: while we're at it. 'arrow-up' instead of 'Esc K' for command history. Now thát would be nice....
 
I'm not sure what Q6 of that faq has to do with this, but it should be noted that AIX uses ksh88 by default, not ksh93.

ksh93 is available in AIX 5.1 and up as /usr/bin/ksh93. With ksh93, you should be able to use the KEYBD trap to make things behave the way you like.

For earlier versions of AIX (4.2.* and 4.3.* at least, not sure about earlier), there's a mostly ksh93 compliant version of ksh available as /usr/dt/bin/dtksh.

Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L

 
section 2.4.6 of O'Reilly Korn Shell book says it is. you have to type part of the word, then ESC, then \, and one of four things happen (stolen from O'Reilly):

if no file exists whose name begins with what you typed, shell beeps and nothing happens

if just one regular file matches, shell completes name and adds space

if just one directory matches, shell completes name and adds /

if there is more than one match, shell completes the non-unique part

IBM Certified -- AIX 4.3 Obfuscation
 
ah i see, you are doing my favorite thing: confusing slashes. ESC-\ is completion, ESC-/ is history.

IBM Certified -- AIX 4.3 Obfuscation
 
What I do since we have a multiplatform environment is edit my profile and add the line set -o vi . Remember you have to log out and back in when changing your profile. Then, hit Esc, then k. This recalls your commands and the command line is basically opened in a vi editor. You can then use the / key to search through your command history, just like when you're searching in vi. You can also keep hitting k to keep going through the commands and use j to go back the other way if you pass the command you're looking for. It takes a little practice to get used to, but I find it invaluable.
 
Hi.
Truusv: To switch to "Esc Esc behavior" you may use set - o emacs.

Stefan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top