[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Perl/C programmers, help pls

Typing away merrily, Chad A. Adlawan produced the immortal words:
>     we have something like 30,000 ++ small files lying around different subdirectories, named 000001.cgi ++.  (from Ultimate Bulletin Board, www.ultimatebb.com, and let me add that their customer support sucks and their documentation is even worse)

You poor bastard.  I had to examine the code for their commercial
version after the BugTraq alerts.  I have never seen such a pile of
shite which someone has dared to charge money for.  Methinks I made my
opinion clear enough to the guy who manages the site run with it.  ;^)

>      can someone please help me with a script w/c searches the contents of all those small files and looks for __" and then replaces them with __"http://www.pexchange.com/__ ? 

man perlrun(1) to see about being able to edit files in place, saving
backups.  Then, from shell-prompt (and this in untested, so take backups
and lots of them :^) :
shell_prompt$ perl -i.old \
  -e 's{}{http://www.pexchange.com/}g' \
  $(find THOSE_DIRECTORIES -name \*.cgi -print)

which should do the job quite nicely.  Note the backslashes - you can
omit them if you make sure to type those three lines as one.

HTML email - just say no --> Phil Pennock
"We've got a patent on the conquering of a country through the use of force.
 We believe in world peace through extortionate license fees."  -Bluemeat

Reply to: