[lug] Changing files on-the-fly - No consensus here
zlynx at acm.org
Wed Sep 17 13:41:12 MDT 2003
On Tue, 2003-09-16 at 11:17, Paul E Condon wrote:
> Try this:
> cat numbers.txt | egrep -v three >numbers.txt
> Of course there really IS a temp file in the pipe, but you don't have
> to create it explicitly
No! Don't do this!
A pipe is not a temporary file. It is a 4K piece of memory. If
numbers.txt is larger than 4K, or if your system is dual processor, this
pipe will erase numbers.txt while it is being read.
Zan Lynx <zlynx at acm.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 189 bytes
Desc: This is a digitally signed message part
More information about the LUG