zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: Zsh workers <zsh-workers@sunsite.auc.dk>
Subject: Re: help with command completion
Date: Wed, 05 Jan 2000 15:46:21 +0000	[thread overview]
Message-ID: <3873674D.6C340DE7@u.genie.co.uk> (raw)
In-Reply-To: <200001051437.PAA10986@beta.informatik.hu-berlin.de>

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)"$(</etc/qconfig)"}%%[:\*[:blank:]]*} )

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.

Oliver Kiddle


       reply	other threads:[~2000-01-05 15:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200001051437.PAA10986@beta.informatik.hu-berlin.de>
2000-01-05 15:46 ` Oliver Kiddle [this message]
2000-01-05 16:42   ` Andrej Borsenkow
2000-01-05 17:07     ` Tanaka Akira
2000-01-06 10:56 Sven Wischnowsky
2000-01-06 11:22 ` Oliver Kiddle
2000-01-06 15:35 ` Tanaka Akira
     [not found] <200001051342.OAA10929@beta.informatik.hu-berlin.de>
2000-01-05 23:52 ` Tanaka Akira
  -- strict thread matches above, loose matches on Subject: below --
2000-01-05 15:55 Sven Wischnowsky
2000-01-05 14:56 Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3873674D.6C340DE7@u.genie.co.uk \
    --to=opk@u.genie.co.uk \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).