Re: Using the same file as stdin and stdout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 02, 2007 at 09:07:38PM +0000, Carl Spalletta wrote:
> The following, of course, doesn't work:
> 
>    sed -e s/foo/bar/g < x > x
> 
> But is there any way to have the same file as input and output using
> any form of shell redirection, but WITHOUT using a temporary file?
> 
> That is just with shell constructs without using, e.g.  the inplace
> option to 'perl'.

Yes, sed -i :)
-- 
When your mind is purified like a mirror knowledge is reflected in it.
                                    Adi Sankaracharya, Hindu saint

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux