James G. Sack (jim) wrote:
> 
> I'm not motivated to follow through, but it could all be done in shell
> (bash2, anyway) without sed. Without any web interface, either, if you
> want to throw in an exec 3<> /dev/tcp/64.233.167.99/80 and echo the
> proper http request out to &3 and read back in from &3.

Oh! Neat!

% zmodload zsh/net/tcp
% ztcp www.google.com 80
% fd=$REPLY
% echo get http://www.google.com/supported_domains http/1.0 >&$fd
% echo host http://www.google.com/supported_domains >&$fd
% echo >&$fd
% <&$fd while read i; do
while> [[ $i == ${(M)i##.google.(^com)} ]] && echo "RewriteCond %{HTTP_REFERER} 
^http://www$i [OR]"
while> done > exclude_list 


Straight zsh, not an external command in sight. Thank you for the
pointer to /dev/tcp/ that bash2 provides. You do get an exit code of 1,
but that is because of the faled read when the query to google has no
more outut.

-john

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

Reply via email to