in reply to Re: Re: I'm looking for a one-liner filter 'twixt two regexes
in thread I'm looking for a one-liner filter 'twixt two regexes

Aw! I get...

C:\temp\>perl -n -e "print if /start/ .. /end/" *.html
Can't open *.html: Invalid argument.

When run under CMD.exe -- I'm not sure if it's perl.exe or CMD.exe complaining here. :(
Msemtd.
  • Comment on Re: Re: Re: I'm looking for a one-liner filter 'twixt two regexes

Replies are listed 'Best First'.
Re: Re: Re: Re: I'm looking for a one-liner filter 'twixt two regexes
by msemtd (Scribe) on Sep 13, 2002 at 08:22 UTC
    Many Thanks to all who replied -- my solution to the CMD.exe problem was resolved with a WinNT batch file(!) to deal with the "*.html" argument...
    @echo off :: aarunme.bat -- on an NT machine with ActiveState Perl, this fella :: will tidy up a mirror of the Slackware Book by exploding the inner +table for %%f in (*.html) do call :func1 %%f goto :EOF :func1 echo %1 perl -ni.bak -e "print if /Norman/ .. /\/BODY$/" %1 :: this line replaces the missing ">" for the closing body tag echo ^> >> %1
    BTW: I really should have the 2nd regex on the closing HTML tag.