in reply to
Re^2: Delete line if REGEX == true
in thread
Delete line if REGEX == true
There is too. Add an
-i.bak
and forget the redirection. See
perlrun
for -i.
C.
Comment on
Re^3: Delete line if REGEX == true
Download
Code
Replies are listed 'Best First'.
Re^4: Delete line if REGEX == true
by
sgifford
(Prior)
on Aug 07, 2005 at 18:18 UTC
The
-i
flag causes perl to do exactly what I've described above. It's shorter syntax, sure, but it still copies the parts of the file you want to keep, then renames the resulting file.
[reply]
[d/l]
In Section
Seekers of Perl Wisdom