From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27716 invoked from network); 5 Jan 2000 15:57:41 -0000 Received: from postoffice.telstra.net (HELO tpostoffice.telstra.net) (203.50.1.76) by ns1.primenet.com.au with SMTP; 5 Jan 2000 15:57:41 -0000 Received: from sunsite.auc.dk (sunsite.auc.dk [130.225.51.30]) by tpostoffice.telstra.net (8.9.3/8.9.3) with SMTP id CAA46598 for ; Thu, 6 Jan 2000 02:57:09 +1100 (EST) (envelope-from zsh-workers-return-9221-mason-zsh=primenet.com.au@sunsite.auc.dk) Received: (qmail 23451 invoked by alias); 5 Jan 2000 15:55:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9221 Received: (qmail 23444 invoked from network); 5 Jan 2000 15:55:05 -0000 Date: Wed, 5 Jan 2000 16:55:04 +0100 (MET) Message-Id: <200001051555.QAA11269@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Oliver Kiddle's message of Wed, 05 Jan 2000 15:46:21 +0000 Subject: Re: help with command completion Oliver Kiddle wrote: > Sven Wischnowsky wrote: > > > Then we can just start generating the printer names in this `if'. One > > possibility is something like: > > > > compadd - "${(@)${(@s:|:)${(@)${(@f)$(< /etc/printcap)}:#[ \#]*}%%:*}%%[ ]*}" > > I was just looking into trying to adapt this to work on AIX aswell. AIX > lists the print queues in /etc/qconfig. > > The following works there: > _lp_cache=( ${${(f)"$( > I am a little unsure what format the /etc/printcap file is supposed to > be in - printcap(5) suggests that | separates alternate names for the > queues but the only printcap file I have access to has entries like > lp|Generic dot-matrix printer entry:\ > > What are the possible queue names in this case - just lp, lp and Generic > or lp and Generic\ dot-matrix\ printer\ entry? My tests imply that it is > just lp. Sven's pattern would imply the answer is lp and Generic. I > can't properly test it because there aren't any real printers attached > to the one Linux machine I have access to. Does anyone know the answer > to this? The following pattern will work for AIX and I think it behaves > the same as Sven's pattern under Linux: > ${(s:|:)${${(f)"$(<$file[1])"}%%[:\#\*[:blank:]]*}} > > I'll not send a patch to _lp though until I've looked at IRIX at home > and established what Linux does about those spaces. Urgh, I almost feared that this would cause trouble. Maybe we should only use the first name for each entry? (I can't really test it either because my printcap lists only one printer with the names lp0, 0, and lp.) Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de