From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17082 invoked from network); 27 Jun 1999 10:03:27 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 27 Jun 1999 10:03:27 -0000 Received: (qmail 17925 invoked by alias); 25 Jun 1999 17:56:12 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2410 Received: (qmail 17917 invoked from network); 25 Jun 1999 17:56:12 -0000 Message-ID: From: Amol Deshpande To: "'zsh-users@math.gatech.edu'" Subject: need help with compctl for NT Date: Wed, 23 Jun 1999 12:23:11 -0700 X-Mailer: Internet Mail Service (5.5.2524.0) hi, I want to complete (For zsh 3.0.x only) the command "net stop" with the output of the command "net start". The output looks something like this: These Windows 2000 services are started: Computer Browser Logical Disk Manager Messenger Net Logon Workstation The command completed successfully. I came up with a completion that seems to work: 'c[-1,stop]' -s "$(net.exe start|grep.exe -v ^T|sed.exe -ne 's/\([A-Z][a-zA -Z].*\)/"\1"/p')" \ The only problem is that this completion only collects the output of "net start" on shell startup. I would like the list to be updated every time i run "net stop ..." I tried using -K with a function like so: function fooger { IFS=\t\n reply=(`net.exe start|grep.exe -v ^T|sed.exe -ne 's/\([A-Z][a-zA-Z].*\)/"\1" /p'`); } the problem with this approach is that it ignores the quotes and seperates the words anyway. Thus, "Computer Browser" becomes "Computer Browser" i.e, 2 separate array elements. Firstly, is my assumption that the function will run every time i type "net stop " correct ? If yes, then is there any way to get what I want to actually work ? thanks,. -amol PS: If all this is really confusing here's the bottom line: How do i get a completion to be the dynamically updated output from an external command, where the command output may contain components with whitepace (just space usually) ?