Re: Perl oneliner to delete lines from a file

2004-08-09 Thread Jose Alves de Castro
On Mon, 2004-08-09 at 07:34, Ramprasad A Padmanabhan wrote: > I want to write a command line perl 'script' to delete one or more > lines from a file , by line number Hi :-) If I understand correctly, you want to delete lines X to Y from a file, right? perl -i -ne 'print unless 1..10' file tha

Perl oneliner to delete lines from a file

2004-08-08 Thread Ramprasad A Padmanabhan
I want to write a command line perl 'script' to delete one or more lines from a file , by line number for eg in sed I can do the same in two steps cat FILENAME | sed -e '1,10d' >FILENAME.TMP mv FILENAME.TMP FILENAME The above mechanism has a lot of pitfalls , like maintaining permi