Re: [cciug] RE conundrum

From: Christian Goetze (cg@digisle.net)
Date: Thu Sep 28 2000 - 19:35:49 EDT


The reason is that a readdir of /view/my_view/vobs/my_project/src will not
return anything with an @@ in it - the same way you don't see @@ with ls.

If you really want to do what you seem to want to do and not use find
(which, btw, won't be much slower than globbing), you will need to use
constructs that do it in two steps, such as:

ls -1 mysrc.? | awk '{print "ls "$0"@@/main/*/LATEST"}' | sh

There is no magic behind globbing... it's really just as slow/fast as find
would be.

--
cg
 
On Thu, 28 Sep 2000, G. M. Harding wrote:

> > Observe the following (all examples in ksh on Solaris 5.5.1): > > $ pwd > /view/my_view/vobs/my_project/src > $ ls -l mysrc.?@@/main/LATEST > mysrc.?@@/main/LATEST: No such file or directory > $ ls -l *.h@@/main/LATEST > *.h@@/main/LATEST: No such file or directory > $ ls -l mysrc.h@@/main/LATEST > -r--r--r-- 1 gm staff 203 Aug 14 18:22 mysrc.h@@/main/LATEST > $ ls -l mysrc.h@@/main/*/LATEST > -r--r--r-- 1 gm staff 6111 Sep 21 19:47 mysrc.h@@/main/my_branch/LATEST > > Note that I'm not using any cleartool commands, just ordinary > Unix commands. > > Can this be right? Shells simply do readdir(3) and stat(2), so > why can the shell match regular expressions in version-extended > file names when the RE occurs in the version-extended portion, > but not when the RE occurs in the file-name portion? After all, > the result of a readdir() is going to be the same in both cases, > isn't it? > > More critically, how can I write scripts using RE's to access > files with version-extended names? (Please don't suggest using > cleartool find, it would be impossibly slow in my application.) > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > > http://clearcase.rational.com/cciug/mailing_list.html >

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



This archive was generated by hypermail 2b29 : Sun May 06 2001 - 00:26:55 EDT