ISO: csh glob to ksh93 glob idea

ISO: csh glob to ksh93 glob idea

Post by lvir.. » Thu, 02 Jul 1998 04:00:00



I ran across a note the other day which referenced:
/usr/src/perl/{lib,pod}/{,*}/*.p{od,m}

How in ksh93 does one get the equivalent of this csh glob?

I thought perhaps

/usr/src/perl/?(lib|pod)/?(|*)/*.p?(od|m)

but some playing with that didn't seem to work.
--

<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.

 
 
 

ISO: csh glob to ksh93 glob idea

Post by brian hil » Tue, 07 Jul 1998 04:00:00


: I ran across a note the other day which referenced:
: /usr/src/perl/{lib,pod}/{,*}/*.p{od,m}
: How in ksh93 does one get the equivalent of this csh glob?
: I thought perhaps
: /usr/src/perl/?(lib|pod)/?(|*)/*.p?(od|m)
: but some playing with that didn't seem to work.

First of all, every ksh from (at least) '88 on has always supported
brace expansion.  However, this is an undocumented feature that
needs to be conditionally compiled into the versions that I know.

The same is true for ksh93, AFAIK. I do not have the source code
for this version.

If you genuinely need to perform brace expansion, download:

ftp.uu.net/usenet/comp.sources.misc/volume4/curly

If it strikes my fancy, I may include am emulation function in my IDE,
seeing as I already an finalizing a ksh-to-csh conversion utility.

-Brian