[prev in list] [next in list] [prev in thread] [next in thread] 

List:       novalug
Subject:    Re: Script help requested
From:       Przemek Klosowski <przemek () rrdjazz ! nist ! gov>
Date:       2000-05-30 16:08:50
[Download RAW message or body]

   1)  The following text must be added to the <head> section
   of each doc:

	   <base target="main">

   2) Delete all opening and closing <form></form> tags and
   their contents (usually spread over three lines).

OH, NO!! NOT ANOTHER PERL ONE_LINER!!!

1) find /opt/httpd/html -name '*.html' | xargs perl -i.bak -pe 'print "<base \
target=\"main\">\n" if m#</head>#i'

   find all the HTML files, edit them in place saving the original in *.html.bak; \
implicitly print all lines,  add the <base> line just before the </head> lines

2) find /opt/httpd/html -name '*.html' | xargs perl -i.bak -ne 'print unless \
m#<form># .. m#</form>#'

   find all the HTML files, edit them in place saving the original in *.html.bak; \
explicitly print   all lines except those between and including lines with <form> and \
</form> in them. Possible problem:  if the <form></form> lines have usefull stuff \
before/after the <form> tags.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic