On 9/11/06, John H. Robinson, IV <[EMAIL PROTECTED]> wrote:
Stewart Stremler wrote:
> _____________________________________________________________________________
> #!/bin/csh -f
>
> set RWCND = "RewriteCond %{HTTP_REFERER}"
>
> mkdir /tmp/$$
> pushd /tmp/$$
>
> wget http://www.google.com/supported_domains
>
> touch exclude_list
> foreach i ( `cat supported_domains | grep -v '^\.google\.com$'` )
>    echo "$RWCND ^http://www$i [OR]" >> exclude_list
> end
>
> popd
> cp /tmp/$$/exclude_list ./
> _____________________________________________________________________________

sh is too easy:

$ for i in `lynx -dump http://www.google.com/supported_domains`; do echo "RewriteCond 
%{HTTP_REFERER} ^http://www$i [OR]"; done > exclude_list

perl is a bit more difficult, as one would likely want to use a perl
module for the http stuff. Bah! Why bother? A shell one-liner is all
that is needed.

OK, but somewhere you have lost the requirement to exclude
"\.google\.com$" from the exclude_list.  So a pipe to "grep -v" is
called for, or else you can say "oops, I have to edit exclude_list
before I actually use it."

   carl
--
   carl lowenstein         marine physical lab     u.c. san diego
                                                [EMAIL PROTECTED]

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to