[Mailman-Developers] Clean output with bin/withlist??

Phil Stracchino alaric@babcom.com
Tue, 31 Jul 2001 17:50:53 -0700


On Tue, Jul 31, 2001 at 07:47:12PM -0400, Scott Brown wrote:
> My first attempt was
> 
> [root@apollo /home/mailman]# echo "m.host_name" | python -i
> /home/mailman/bin/withlist test2
> Loading list: test2 (unlocked)
> >>> 'apollo.host-ops.com'
> >>>
> Finalizing
> [root@apollo /home/mailman]#
> 
> But there's all that other crap that I'd prefer not to get, so that I dont
> have to parse it out....
> 
> Anyone got any ideas??


Assuming the format of that output is consistent, try this in your perl 
script:

($pref_host = `echo "m.host_name" | python -i`[2]) =~ s/.*'(.+)'/$1/;


-- 
 Linux Now!   ..........Because friends don't let friends use Microsoft.
 phil stracchino   --   the renaissance man   --   mystic zen biker geek
        alaric@babcom.com                halmayne@sourceforge.net
   2000 CBR929RR, 1991 VFR750F3 (foully murdered), 1986 VF500F (sold)