home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!mcsun!sun4nl!fwi.uva.nl!janw
- From: janw@fwi.uva.nl (Jan Wortelboer)
- Subject: Re: Question on sed
- Message-ID: <1993Jan26.105005.21608@fwi.uva.nl>
- Sender: news@fwi.uva.nl
- Nntp-Posting-Host: mail.fwi.uva.nl
- Organization: FWI, University of Amsterdam
- References: <1993Jan24.102643.63110@cc.usu.edu> <halverso.727899661@staff.tc.umn.edu> <C1E9Mp.v4@cmie.ernet.in>
- Date: Tue, 26 Jan 1993 10:50:05 GMT
- Lines: 37
-
- rs@cmie.ernet.in (Rajappa Iyer) writes:
-
- >halverso@staff.tc.umn.edu (Chris Halverson) writes:
-
- >>In <1993Jan24.102643.63110@cc.usu.edu> sl0k3@pluto.ee.usu.edu (Saturn) writes:
- >>>Hi,
- >>> My appologies if this is a FAQ.
- >>>How does one apply some editing commands to
- >>>a file using sed without having to redirect
- >>>output to another file. I want the changes to
- >>>appear on the same file.
-
- >>Use Perl instead. It can does all of the sed commands and will write
- >>back to the file.
-
- >Or try something like this:
-
- >sed <sed commands> file > /tmp/$$ && mv /tmp/$$ file
-
- The answer is more simple if you simple want to edit a file use ed
- sed is only the stream version of ed
-
- e.g.
-
- ed file <<!
- /search/s/aap/mies/
- w
- q
- !
-
-
- Jan.
- --
- Jan Wortelboer, University of Amsterdam
- Computer Science Department Email: janw@fwi.uva.nl
- Unix Kruislaan 403 Kamer F003 Phone: +31 20 525 7501
- systems manager 1098 SJ AMSTERDAM Fax : +31 20 525 7490
-