set filec in the KSH?

lawrence.v.cipriani lvc at cbnews.cb.att.com
Tue Apr 16 00:16:32 AEST 1991


In article <1991Apr14.222646.29794 at cbnews.att.com>, lvc at cbnews.att.com (lawrence.v.cipriani) writes:
> In article <1991Apr14.175109.10183 at magnus.acs.ohio-state.edu> mcover at magnus.acs.ohio-state.edu (Mark Coverdill) writes:
> >
> >Having used the csh for many months I find myself having to switch to
> >the ksh. I really miss the ability to complete a filename by hitting
> >the ESC key aka the 'set filec' command in the csh. Is there such a
> >command in the ksh?
> 
> You can use <ESC> followed by * for filename completion.

I got a correction to this:

+ Yes, but the equivalent to ESC on the csh is ESC \ in ksh. ie,
+ it will expand only to the common prefix if there is more than
+ 1 match. If you have files "psycho" and "psyllium", then hitting
+ ESC * after a p will expand to "psycho psyllium_" while ESC \
+ will expand only to "psy_" ...
+ -- 
+     
+ Eduardo Krell                   AT&T Bell Laboratories, Murray Hill, NJ
+ 
+ UUCP: {att,decvax,ucbvax}!ulysses!ekrell  Internet: ekrell at ulysses.att.com

> For example, suppose in my home directory is:
> 
> 	$ ls $HOME
> 	psycho
> 	loopy
> 
> Then I can enter:
> 
> 	$ vi $HOME/p<ESC>*
> 
> and the command completes to:
> 
> 	$ vi $HOME/psycho_
> 
> the _ marking the cursor position.

That's what I get for not testing out every post.  What it really expands
to is:
	$ vi /u/lvc/p_

If you give a complete path and enter <ESC> * you'll get:

	$ vi /u/lvc/psycho_

Probably what you want to use is <ESC> \.  Also, if you enter <ESC> =
you'll get a list of filenames that match the pattern.  So in Edward's
example, typing:

	$vi /u/lvc/p<ESC>=

gives you:

	1) psycho
	2) psyllium
	$ vi /u/lvc/p_
-- 
Larry Cipriani, att!cbvox!lvc or lvc at cbvox.att.com
"Offensive is in the eye of the beholder." -- me



More information about the Comp.unix.shell mailing list