home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / os2 / misc / 27910 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  1.6 KB

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