On Thursday 25 April 2002 15:10, you wrote: | I'm not quite sure what you're trying to do with this... but from what | you've provided, the regular expression you wrote will only remove text | matching "....sub html_base...." on a single line -- and not even the | newline at the end. The '-pi' switches will grab a single line at a time | from the currently open file to compare to the expression. | | It sounds like you've got a subroutine you're trying to remove from some | files: | sub html_base { | ... | }
exact, that's it. but i've got the solution to that problem (i forgot to put the trailing 's' in my post, but i used it and it did not work) the solution is: perl -p0i -e 's/sub html_base.*//s' *.cgi it does exactly what i need, and is very fast. thanks for your answer Alain Scieur | yes? If so, it might make more sense to make a quick-and-dirty perl | script that will take the fileglob (*cgi), read one file at a time, and | read that entire file into a single string, and then run the regexp you | wrote against it, with the following addition: | s/sub html_base[\s\S]*//s | The trailing 's' will allow the regexp to look over newlines (\n) when | matching. | | --Matthew | | On Thu, 25 Apr 2002 04:10:58 -0400, Alain wrote: | > Hello all, | > | > I've the following problem: | > I need to erase about 150 lines (always the same lines) at the end of a | > serie of files. | > What I have done in the shell is: | > #perl -pi -e "s/sub html_base[\s\S]*//" *cgi | > | > But this command only erase one line at once. And I want to erase all | > the lines in one time. Is there anybody who can help? | > | > Thanks a lot | > | > Alain Scieur -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]