Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] sed / shell / redirection question
- Date: Sun, 6 May 2007 16:54:18 +0200
- From: Godwin Stewart <gstewart@example.com>
- Subject: Re: [tlug] sed / shell / redirection question
- References: <463DE078.2090005@pitchpipe.org>
On Sun, 06 May 2007 23:04:40 +0900, Mark Makdad <mark@example.com> wrote: > My question is: > > Why did this take all of my input files and truncate them at zero > bytes? Because the command is handled this way: 1) The shell sets up a file descriptor to suck up the output from sed while it's running. In doing so, it opens the file for output, thus truncating it. 2) The shell starts sed and funnels its output through the file descriptor it created in the previous step. 3) sed opens the file for input, sees it is empty and stops there and then. > Am I screwing up a basic redirection thing there? Yes. You don't need it. Look at sed's -i option in the man page. -- G. Stewart - gstewart@example.com "Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we." -- President George W. Bush addressing the Pentagon, 05-AUG-2004Attachment: pgpwfuZsZP1Zx.pgp
Description: PGP signature
- References:
- [tlug] sed / shell / redirection question
- From: Mark Makdad
Home | Main Index | Thread Index
- Prev by Date: [tlug] sed / shell / redirection question
- Next by Date: [tlug] sed / shell / redirection question
- Previous by thread: [tlug] sed / shell / redirection question
- Next by thread: [tlug] sed / shell / redirection question
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links