home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / question / 15413 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  1.1 KB

  1. Path: sparky!uunet!pipex!bnr.co.uk!uknet!keele!phd85
  2. From: phd85@keele.ac.uk (D.H. Holden)
  3. Newsgroups: comp.unix.questions
  4. Subject: sed/awk guru's help wanted.
  5. Keywords: sed/awk
  6. Message-ID: <C0p46K.5xy@gabriel.keele.ac.uk>
  7. Date: 11 Jan 93 15:25:32 GMT
  8. Sender: news@gabriel.keele.ac.uk (UseNet News Service)
  9. Organization: Keele University, England
  10. Lines: 37
  11. Nntp-Posting-Host: seq1.cc.keele.ac.uk
  12.  
  13.  
  14.      Hi,
  15.       I'd like to be able to use grep to search several files for the
  16.       occurence of a string, and then to edit those files that have
  17.       this string in them.
  18.  
  19.        i.e,
  20.  
  21.        grep -i poly *.f *.c
  22.  
  23.        this gives a list like,
  24.  
  25.        polynom.f:  text.....
  26.        fred.f:     text....
  27.        fred.f:     text....
  28.        fred.f:     text....
  29.        main.c:     text....
  30.        work.c:     text....
  31.        work.c:     text....
  32.        work.c:     text....
  33.  
  34.          I would like to pipe this output to a script so that it gives
  35.          just the filenames on a vi command line i.e.,
  36.  
  37.          vi polynom.f fred.f main.c work.c
  38.  
  39.       can anyone help?
  40.  
  41.       thanks a lot,
  42.                 Dave.
  43.  
  44.  
  45. --
  46.                                                                      
  47.  
  48. phd85@uk.ac.keele.seq1
  49. keele university. 
  50.