home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!sangam!cmie!rs
- From: rs@cmie.ernet.in (Rajappa Iyer)
- Subject: Re: Question on sed
- Message-ID: <C1E9Mp.v4@cmie.ernet.in>
- Organization: Centre for Monitoring Indian Economy, Bombay
- References: <1993Jan24.102643.63110@cc.usu.edu> <halverso.727899661@staff.tc.umn.edu>
- Date: Mon, 25 Jan 1993 05:23:10 GMT
- Lines: 23
-
- 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
-
- There is a cute script called ow (I think! Stands for overwrite.) in
- Kernighan and Pike's "The Unix Programming Environment" which makes it
- simple to do "in-place" substitutions.
- --
- Rajappa Iyer rs@cmie.ernet.in (Preferred)
- riyer@shakti.ncst.ernet.in
-