From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15475 invoked from network); 6 Nov 1997 08:29:02 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 6 Nov 1997 08:29:02 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id DAA17974; Thu, 6 Nov 1997 03:17:57 -0500 (EST) Resent-Date: Thu, 6 Nov 1997 03:16:27 -0500 (EST) To: zsh-users@math.gatech.edu Path: mason From: mason@primenet.com.au (Geoff Wing) Newsgroups: lists.zsh.users Subject: Re: how can i get lynx news: done? Date: 6 Nov 1997 08:16:28 GMT Organization: PrimeNet Australia Message-ID: References: <9710291450.AA16230@rzaix41.rrz.uni-hamburg.de> Reply-To: mason@primenet.com.au NNTP-Posting-Host: 203.24.36.33 X-Trace: coral.primenet.com.au 878804188 15433 [si+d8+BtNicx2i/AojofLTkRRi65ITye] 203.24.36.33 X-Complaints-To: usenet@coral.primenet.com.au X-Newsreader: slrn (0.9.4.3 UNIX) Resent-Message-ID: <"WOcGd.0.zN4.QpNOq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1124 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu fk5a005@rrz.uni-hamburg.de typed: :i sometimes love to view only a few new mails in a newsgroup. :then i take my lynx and let it view the newsserver with a special :newsgroup. :only the newsgroup should be a variable. because i read many newsgroups. :lynx news: : should be completed. :say, i wanted to search for unix in newsgroup-names with the script below:. :cat ~/..nn/ACTIVE | cut -d ' ' -f1 | grep $1 :now i want zsh to complete all found unix-newsgroups for me to choose from. :and then invoke lynx news: :anyone here, who has a solution? :i simply do not get it. :i think, -P "news:" should be there with compctl, the rest i am not sure. :I only think , i need a function which should be completed somehow. OK, it's been about a week and nobody has answered yet. Please note that I'm probably one of the lesser qualified to answer this as there are several (very quiet or very busy or very lazy) compctl gurus around. Here's a starting point. Note that I've been lazy and left it to you to tidy it up. eg. ``lynx ne'' won't work properly because "ne" won't be stripped out in the second line of getgroups(), so you'll get all matches for ``ne''. getgroups() { local v="$1$2" v=${v:s#news:##} reply=( $(cut -d' ' -f1 < ~/..nn/ACTIVE | fgrep "$v") ) } compctl -U -P 'news:' -K getgroups - lynx -- Geoff Wing [gcw@pobox.com] Phone : +61-3-9818 2977 Technical Manager: PrimeNet Computer Consultants Facsimile: +61-3-9818 5155 Web: Mobile : 0412 162 441