On Tue, 11 Jun 2002, Paul Branston wrote: > On Mon, Jun 10, 2002 at 09:42:56PM -0400, David Kramer wrote: > > > > sed -e '/VirtualHost \*/,/\/VirtualHost/d' </www/conf/httpd.conf >>/www/conf/httpd.conf > > Hi David, > > Did you test this ?? I can tell you from bitter experience that you > need an intermediate file, using sed to read from some file > and write the result out to the same file simply does not work.
You caught me. I tested it, but in my test I let the output go to stdout. You are absolutely correct. catting a file and writing to the same file at the end of the pipe will never work. You can simulate it with perl's -i parameter, but even that uses a temp file behind the curtains. Sorry about that. As it turns out this solution didn't meet the poster's needs, but I found another solution. > I hope I'm not hurting David's feelings by posting this but I > didn't want to see someone's files end up lacking in content whilst > I bite my tongue. No problemo. In an environment like this it's much better to correct someone, lest a lurker try it and trash their system. Thanks for correcting me. ------------------------------------------------------------------- DDDD David Kramer http://thekramers.net DK KD DKK D DK KD Pretense and adversity are inversely proportional; DDDD Adversity reveals the true nature of all things. _______________________________________________ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list