1836451 Members
2432 Online
110100 Solutions
New Discussion

escape-escape

 
SOLVED
Go to solution
Anthony Baldwin
Occasional Advisor

escape-escape

Hello everyone. Can someone explain something to me. In HP-UX, when your at the command prompt in a particular directory, lets say that the directory is /users/joe and in that directory there is a file called question.txt. If I were to type the letters q-u-e and then hit escape-escape, something reads the directory to find if there is a file there that starts with those letters. If there is (let's say that that is the only file that starts with q-u-e), it will complete the "typing" of that named file within the directory, displaying the full name at your command prompt.

Does anyone know how this is accomplished? Is this something that is specific to HP-UX or is it general th UNIX -- and if it is general to UNIX, is there some evironment/configuration setup that needs to happen if you want to accomplish this on a different UNIX platform (specifically AIX). Please let me know what information you have about this. Thanks in advance. Enjoy.

Anthony
Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding.
9 REPLIES 9
Rodney Hills
Honored Contributor

Re: escape-escape

This is a feature of the korn shell (ksh) called autocompletion.

One note- Let's say you have two files, MACRO and MACARENA, you type MA then press esc-esc, ksh will add the C but that is it. You can type an "=" at this point and ksh will display the possible filenames that match up to MAC.
There be dragons...
MANOJ SRIVASTAVA
Honored Contributor

Re: escape-escape

Hi Anthony

It is a function of ksh . Actually ksh keeps a history of commands previuosly run and tries to match with the nearest fit in case you type few alphabets and press esc esc . Also in the SUN system I have seen it being acomplished with esc and * . In case there is an ambuguity it matches till the place there is no ambiguity.

Manoj Srivastava
federico_3
Honored Contributor

Re: escape-escape

Posix and Ksh shell both implement the C shell feature , file name completition.this allow you to type a unique subset of letters or abbreviation for a file name or path name followed by ESC ESC, and the system matches and completes the name.
Tracey
Trusted Contributor

Re: escape-escape

ksh also has the ability reo recall your last "X" commands (whatever number you have set up for your history. It is ESC then J or K to go up/down.
Anthony Baldwin
Occasional Advisor

Re: escape-escape

Thanks everyone. I hear what your saying. But why doesn't it work for AIX? I'm using ksh there also. Any clues? Thanks in advance.

Anthony
Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding.
Laurent Paumier
Trusted Contributor
Solution

Re: escape-escape

As already answered, this feature called autocompletion is accomplished by the shell. posix shell and ksh do it using ESC-ESC, csh does it with ESC, bash and tcsh do it using the TAB key... Do a man on your AIX box and search for "completion".
Rodney Hills
Honored Contributor

Re: escape-escape

File name complete is set by option +f.

Under ksh enter set +f to turn it on
set -f to turn it off
There be dragons...
MANOJ SRIVASTAVA
Honored Contributor

Re: escape-escape

Anthony

Try setting up with ksh -o vi , just a thought .

Manoj Srivastava
Anthony Baldwin
Occasional Advisor

Re: escape-escape

Thanks everyone. In the man pages for ksh on AIX, it didn't specify how to use file name completion (it did say that the -f option disabled file name substitiution). However, I did find that on AIX you must use "ESC \" for file name completion and "ESC =" will give you a list of all files that start with the given letter combination. Thank you all again. Your help is very much appreciated. Regards.

Anthony

(NOTE: This forum support is a valuable tool that I haven't found a comparison with IBM's AIX. Much applause to HP.)

Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding.