[ic] lpr within a usertag

Kevin Walsh kevin at cursor.biz
Fri Feb 1 19:13:00 EST 2008

Grant <emailgrant at gmail.com> wrote:
> I'm able to print from my remote IC machine to my local printer server
> with 'lpr file.pdf' but I'm having trouble making it work within an IC
> usertag.  I'm using the following to test it:
> Usertag print Order
> Usertag print Routine <<EOR
> sub {
>         'lpr /catalogpath/file.pdf';
> }
> I've also tried specifying just file.pdf without the absolute path but
> neither works.  There is nothing in either error.log.  Does anyone see
> what's wrong here?
You used single quotes instead of backticks.  Your UserTag will have
returned the string verbatim, with no errors in the logs, as it will
have done exactly as you asked (return a scalar value).

You should use system() instead of backticks for readability, and to
help avoid this sort of problem.

Note that you'll only be able call out like this from within a global
UserTag.  Note also that you should always specify the full path to
executables to avoid $PATH-related problems and attacks.

You should consider using email instead of paper.  Emails are far more
convenient to forward, archive and search, and you can always print
them if you really need to.  Exposing a LPD port to the world doesn't
strike me as such as good idea either.

   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/

More information about the interchange-users mailing list