Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com Subject: Re: perl -i is very dangerous ! References: <3CD2B64F DOT 5090005 AT wanadoo DOT fr> <120108386090 DOT 20020503201623 AT nyckelpiga DOT de> Organization: Private From: pjacklam AT online DOT no (Peter J. Acklam) Date: 06 May 2002 22:34:05 +0200 In-Reply-To: <120108386090.20020503201623@nyckelpiga.de> Message-ID: Lines: 24 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii "Gerrit P. Haase" wrote: > Marc schrieb: > > > mc AT MILLENIUM:~/test/perldestroy# cat test.txt > > this is > > a test > > for cygwin > > mc AT MILLENIUM:~/test/perldestroy# perl -i -ne 's/this/works/' test.txt > > Can't do inplace edit on test.txt: Permission denied. > > mc AT MILLENIUM:~/test/perldestroy# ls > > any idea ? > > It is gone. > > Use perl -i.bak instead. Not to mention to use -p and *not* -n. The -n option will not write back to the file, so it will end up having size zero. Peter -- Where do bit streams end? In bit rivers? -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/