> -----Original Message-----
> From: Alain [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 4:25 AM
> To: [EMAIL PROTECTED]
> Subject: help about perl -pi -e
> 
> 
> 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?

What do you mean by "erase all the lines?"

The command you have written will change all of
the matching lines in each file.

Do you want to delete all the lines in each file
that follow "sub html_base[sS]"? If so, try this:

   perl -n -i.bak -e 'print unless /sub html_base[sS]/ .. eof'

That prints each line unless it lies between the
line containing sub html_base[sS] and the end of
the current file.

   perldoc perlop (search for "Range Operators")
   perldoc -f eof

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to