Closed p5pRT closed 20 years ago
Say we create a file and perform an in-place edit on it\, saving the backup:
[79] carl@caesar:\~/testing> echo "1" > test [82] carl@caesar:\~/testing> perl -pi.bak -e 's/1/23/g' *
Here are the two files we're left with:
[81] carl@caesar:\~/testing> ls -l total 2 -rw-r--r-- 1 carl users 3 Jul 15 14:29 test -rw-r--r-- 1 carl users 2 Jul 15 14:29 test.bak
Now look what happens whene we run another pass on these new files:
[82] carl@caesar:\~/testing> perl -pi.bak -e 's/23/456/g' * [83] carl@caesar:\~/testing> ls -l total 3 -rw-r--r-- 1 carl users 4 Jul 15 14:29 test -rw-r--r-- 1 carl users 4 Jul 15 14:29 test.bak -rw-r--r-- 1 carl users 3 Jul 15 14:29 test.bak.bak
'test' and 'test.bak' are identical\, and 'test.bak.bak' contains a backup of 'test'. Is this the expected behavior?
Migrated from rt.perl.org#1003 (status was 'resolved')
Searchable as RT1003$