[cups.general] How to alias existing CUPS printerstogetadditionalpaper tray capability?

Michael Sweet mike at easysw.com
Sun Mar 26 14:30:37 PST 2006


Michael Talbot-Wilson wrote:
> ...
>> No clue.  From what I can guess from the dvips man page, they assume
>> you are using lpr, so you'll need to pass in the base queue name via
>> the -P option to get meaningful results, something like:
>>
>>    dvips ... -P `dirname $dest` ...
>>
>> where $dest is defined to be the printer/instance name.
> 
> I think you may have momentarily missed the point.

I didn't think there was one...

> ...
>>> It is ... unusual ... that '/' was selected as the instance separator
>>> in software aimed at Unix.
>>
>> Not at all, the instance is associated with the printer, much like
>> a file is associated with a directory.
> 
> I don't follow your logic.  Or rhetoric.

UNIX, like most operating systems, uses the slash character to
define a hierarchy of files and directories.  CUPS uses the slash
character to define a hierarchy of printers and instances.

We chose this character because it seemed natural and obvious to
anyone familiar with files and directories, and it is consistent
with many name services (such as those employed in Solaris, Linux,
MacOS X, Windows, etc.) for identifying resources that are related
in a tree-like way.

In short, any other character would have been inconsistent with
the rest of the computing world.

(And, FWIW, this discussion is completely academic, as we will
*not* be changing things...)

>> What is unusual is that dvips makes assumptions about the printer
>> name, like it can be used as a filename (lpr even allows spaces in
>> alias names!)
> 
> Why are spaces in alias names a problem?

Because without quoting, manipulating filenames with spaces from
the shell is a pain in the ass.  Doing so from shell scripts is
doubly hard because you have to be careful about re-quoting these
filenames whenever you use them, and common shell looping mechanisms
to not work with them.

>>> Perhaps one can s|/|^|g throughout the source tree.
>>
>> Yeah, replace a safe character with a special shell character...
> 
> What shell do you use?  For bash it is a _default_ histchar.

Um, yes.  It has a special meaning.  Thus, "special character".

> In any case, read "some character", rather than turning the flame
> thrower on one suggestion.

"/" is the only character that is commonly used to indicate a
hierarchy in UNIX.  ":" is a close second and is used by several
languages to indicate class hierarchy, however some shells use it
with variable substitution making it unsuitable.

"@" is commonly used to identify hosts, which is what we use it
for in CUPS.

"," is commonly used for lists and would probably be very
confusing.

"-", "_", and "." are valid and common printer name characters.

"+" is commonly used for addition; you *could* make an argument
for this character, e.g. "LJ4000 plus these options"...

The following characters have special meaning and thus are
unsuitable: `, !, #, $, %, ^, &, *, (, ), =, [, ], {, }, \, |,
;, :, ', ", <, >, and ?.

You might notice that I listed every non-alphanumeric character
from a US keyboard...  Our choices are quite limited.

> There is a problem with "/".  Calm down, and don't shoot the
> messenger.

No, there isn't.  There *is*, however, a problem with dvips for
making assumptions about what a printer name can contain.

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Publishing Software        http://www.easysw.com




More information about the cups mailing list