home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!bnr.co.uk!uknet!keele!phd85
- From: phd85@keele.ac.uk (D.H. Holden)
- Newsgroups: comp.unix.questions
- Subject: sed/awk guru's help wanted.
- Keywords: sed/awk
- Message-ID: <C0p46K.5xy@gabriel.keele.ac.uk>
- Date: 11 Jan 93 15:25:32 GMT
- Sender: news@gabriel.keele.ac.uk (UseNet News Service)
- Organization: Keele University, England
- Lines: 37
- Nntp-Posting-Host: seq1.cc.keele.ac.uk
-
-
- Hi,
- I'd like to be able to use grep to search several files for the
- occurence of a string, and then to edit those files that have
- this string in them.
-
- i.e,
-
- grep -i poly *.f *.c
-
- this gives a list like,
-
- polynom.f: text.....
- fred.f: text....
- fred.f: text....
- fred.f: text....
- main.c: text....
- work.c: text....
- work.c: text....
- work.c: text....
-
- I would like to pipe this output to a script so that it gives
- just the filenames on a vi command line i.e.,
-
- vi polynom.f fred.f main.c work.c
-
- can anyone help?
-
- thanks a lot,
- Dave.
-
-
- --
-
-
- phd85@uk.ac.keele.seq1
- keele university.
-