This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: perl -i is very dangerous !
- From: pjacklam at online dot no (Peter J. Acklam)
- To: cygwin at cygwin dot com
- Date: 06 May 2002 22:34:05 +0200
- Subject: Re: perl -i is very dangerous !
- Organization: Private
- References: <3CD2B64F.5090005@wanadoo.fr><120108386090.20020503201623@nyckelpiga.de>
"Gerrit P. Haase" <freeweb@nyckelpiga.de> wrote:
> Marc schrieb:
>
> > mc@MILLENIUM:~/test/perldestroy# cat test.txt
> > this is
> > a test
> > for cygwin
> > mc@MILLENIUM:~/test/perldestroy# perl -i -ne 's/this/works/' test.txt
> > Can't do inplace edit on test.txt: Permission denied.
> > mc@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/