Wildcard-specs
    Michael Meissner 
    meissner at dg_rtp.UUCP
       
    Thu Oct 16 00:24:10 AEST 1986
    
    
  
In article <191 at hwee.UUCP> hmc at hwee.uucp (Hugh Conner) writes:
> In article <4142 at brl-smoke.ARPA> VERACSD at usc-isi.arpa writes:
>>Does UNIX support recursive directory-level matching?  i. e. Does it allow one
>>to wildcard-specify all files in a dir as well as all files in the dir's
>>subdirectories?  cf. the use of "**" in Symbolics' pathnames.
>
> We've had discussions about this at meetings of our Local user group. It is
> one feature which we all agree is lacking. Unfortunately we cannot agree on a
> neat, workable, solution. Suggestions include using ** as mentioned above,
> making * match subdirectories as well (it does in cpio), among others. I'd
> be interested to know if anyone has other solutions, and if anyone has actually
> implemented it.
   I use Data General's AOS/VS operating system, as well as our UNIX(es), and
this is an area where each system has some concepts that the other could
pick up.  In this case, AOS/VS has the following wildcard characters:
	+	Match any string except a directory separator (* in UNIX).
	-	Match any string except a directory separator that doesn't
		contain a period.
	*	Match any single character except a directory separator or a
		a period (somewhat like in UNIX).
	#	Match all files in subordinate directories.
	\	Omit a given pattern from being matched.
	:	Directory separtor (/ in UNIX).
Thus, if I wanted to match all of the C files, except those that begin with
z, I would specify the pattern:
	cmd #:+.c\z+
Obviously if such a scheme were to be put into UNIX, the characters used
would have to be changed (\ in particular).  However, the # and the \ wild-
cards are VERY powerful.
    To get the same effect in UNIX as the wildcard above, I would have to do
something like:
	find . -type f -name "\.c$" | egrep -v "^z" | xargs cmd
	Michael Meissner, Data General
	...{ decvax, ucbvax, inhp4 }!mcnc!rti-sel!dg_rtp!meissner
    
    
More information about the Comp.unix
mailing list