Perl with -i option removes files
Volker Quetschke
quetschke@scytek.de
Wed Jan 22 15:30:00 GMT 2003
Hi!
Following szenario:
$ echo abc > testfile
$ perl -p -i -e 's/b/x/g' testfile
Can't do inplace edit on testfile: Permission denied.
$ ls -l testfile
ls: testfile: No such file or directory
If I use:
$ perl -p -i".bak" -e 's/l/x/g' testfile
I get an unchanged testfile.bak plus a changed testfile.
Is this a bug or feature?
$ cygcheck -c cygwin perl
Cygwin Package Information
Package Version
cygwin 1.3.17-1
perl 5.6.1-2
on Windows 2000 Professional Ver 5.0 Build 2195 Service Pack 3.
I also tested this sequence on:
[q@unics]~:{349}:$ uname -a
SunOS unics 5.8 Generic_108528-16 sun4u sparc SUNW,Ultra-Enterprise
[q@unics]~:{351}:$ perl -v
This is perl, version 5.005_03 built for sun4-solaris
where it doesn't remove the file.
Bye
Volker
--
PGP/GPG key (ID: 0x9F8A785D) available from wwwkeys.de.pgp.net
key-fingerprint 550D F17E B082 A3E9 F913 9E53 3D35 C9BA 9F8A 785D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 251 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20030122/54f7d73c/attachment.sig>
More information about the Cygwin
mailing list