home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!cvedc!billt
- From: billt@cvedc.prime.com (Bill Tracy)
- Newsgroups: comp.os.os2.misc
- Subject: Re: Does Os/2 Have The Equai
- Message-ID: <1992Aug20.213139.10270@cvedc.prime.com>
- Date: 20 Aug 92 21:31:39 GMT
- Article-I.D.: cvedc.1992Aug20.213139.10270
- References: <714223952.6@wyrm.rbbs-net.ORG> <1992Aug20.040838.8004@unixg.ubc.ca>
- Organization: Computervision R&D, Beaverton OR
- Lines: 37
-
- ochealth@unixg.ubc.ca (ochealth) writes:
-
- (extra stuff removed)
-
- >No no no. That's not what he meant. I think he already has grep etc.
-
- >grep "---" `find foobar` is what he was asking.
-
- >In a UNIX C shell, the backquotes run that program, and leave the results
- >in the command line (in this case).
-
- >SO the `find ..` would expand to ./file1 ./file2 ./file2 etc.
- >Then those files would become the arguments to grep.
-
- >Confusing, but then this is UNIX.
-
- >BTW I *would* like to know if this is possible under OS/2. Maybe some bizarre
- >4OS/2 command? Anyway, it's a function of the shell, not the OS. Maybe when
- >bash gets ported...;-)
-
- The shell (csh, bash, whatever) provides the backquote feature, but it
- has problems if the output gets too large.
-
- Another way of doing the same, is the xargs command as follows:
- find foobar -print | xargs -n100 grep "-----"
- would use 100 lines of output from find, and invoke grep with its
- arguments on this list of 100 files.
-
- So, you control the length of the list, you invoke grep only a few
- times, and you get a similiar result to using backquotes.
-
- GNU find includes xargs - and now you know the rest of the story...
- --
-
-
- Bill Tracy ..tektronix!ogcvax!cvedc!wtracy
- Prime Computer,Inc. ..sun!cvbnet!cvedc!wtracy
-