From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 672 invoked from network); 1 Jun 2002 03:55:34 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 1 Jun 2002 03:55:34 -0000 Received: (qmail 19872 invoked by alias); 1 Jun 2002 03:55:22 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5022 Received: (qmail 19861 invoked from network); 1 Jun 2002 03:55:22 -0000 KRecCount: 1 X-Authentication-Warning: hamster.int.radiomaranon.org.pe: spiegl set sender to zsh.Andy@spiegl.de using -f Date: Fri, 31 May 2002 22:50:25 -0500 From: Andy Spiegl To: ZSH User List Subject: trying completion of varying data Message-ID: <20020531225024.A17033@radiomaranon.org.pe> Mail-Followup-To: ZSH User List Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8BIT User-Agent: Mutt/1.3.23i X-PGP-GPG-Keys: finger pgp.andy@spiegl.de OR mail -s "send pgp" auto@spiegl.de Organization: Radio =?iso-8859-15?B?TWFyYfHzbiw=?= Peru Hi, I am trying to write a completion rule for xvncviewer that only completes the hosts that are actually turned on in my subnet. So everytime before showing me the possible completions it has to check for running hosts. This second part isn't so hard, e.g. like this: foreach ip (`nmblookup "*" | cut -f1 -d" " | grep "^[0-9.]*$"`) host $ip | grep Name: | cut -d" " -f2 end (sorry, I'm sure you guys would do that better and faster) But then how do I get zsh to complete only these hostnames??? Looking at these working examples: zstyle ':completion:*:*:mpg123:*' file-patterns \ '*.(mp3|MP3):mp3\ files *(-/):directories' zstyle ':completion:*:processes' command 'ps -au$USER' I tried zstyle ':completion:*:*:xvncviewer:*' command 'show.active.pcs' (where show.active.pcs does the above) but it doesn't even try to call the show.active.pcs script. Please give me a hint what I'm doing wrong or any other suggestions. Thanks! Andy. -- http://peru.spiegl.de Our project http://radiomaranon.org.pe Radio Marañón, Jaén, Perú o _ _ _ ------- __o __o /\_ _ \\o (_)\__/o (_) -o) ----- _`\<,_ _`\<,_ _>(_) (_)/<_ \_| \ _|/' \/ /\\ ---- (_)/ (_) (_)/ (_) (_) (_) (_) (_)' _\o_ _\_v ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "We're going to turn this team around 360 degrees." (Jason Kidd, upon his drafting to the Dallas Mavericks)