<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Pipe for multiple printer! in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/pipe-for-multiple-printer/m-p/3152534#M157828</link>
    <description>Print a text file to one printer, it is easy!&lt;BR /&gt;# more $$.txt|lp -d lj5_1&lt;BR /&gt;But I want to print this file to multiple printer , how to?&lt;BR /&gt;Note that pipe-use is necessary because $$.txt file is generate from an application and is temporary.&lt;BR /&gt;===================================&lt;BR /&gt;The following is the reason why I must do this!&lt;BR /&gt;I have an application! I setup the printer in the application like this:&lt;BR /&gt;&lt;BR /&gt;Printer-Name     UNIX-Command&lt;BR /&gt;lj5acc           lp -d lj5_1 -onb&lt;BR /&gt;lj5pur           lp -d lj5_2 -onb&lt;BR /&gt;&lt;BR /&gt;When selecting the printer, I can only select lj5acc or lj5pur. I guest it print the job use pipe like this:&lt;BR /&gt;# cat jobs|lp -d lj5_1 -onb&lt;BR /&gt;Now one user request that he must print his file to lj5_1 &amp;amp; lj5_2, so how can I make "UNIX-Command" for this task?&lt;BR /&gt;&lt;BR /&gt;Very sorry for my poor English!</description>
    <pubDate>Fri, 26 Dec 2003 03:23:54 GMT</pubDate>
    <dc:creator>Fragon</dc:creator>
    <dc:date>2003-12-26T03:23:54Z</dc:date>
    <item>
      <title>Pipe for multiple printer!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pipe-for-multiple-printer/m-p/3152534#M157828</link>
      <description>Print a text file to one printer, it is easy!&lt;BR /&gt;# more $$.txt|lp -d lj5_1&lt;BR /&gt;But I want to print this file to multiple printer , how to?&lt;BR /&gt;Note that pipe-use is necessary because $$.txt file is generate from an application and is temporary.&lt;BR /&gt;===================================&lt;BR /&gt;The following is the reason why I must do this!&lt;BR /&gt;I have an application! I setup the printer in the application like this:&lt;BR /&gt;&lt;BR /&gt;Printer-Name     UNIX-Command&lt;BR /&gt;lj5acc           lp -d lj5_1 -onb&lt;BR /&gt;lj5pur           lp -d lj5_2 -onb&lt;BR /&gt;&lt;BR /&gt;When selecting the printer, I can only select lj5acc or lj5pur. I guest it print the job use pipe like this:&lt;BR /&gt;# cat jobs|lp -d lj5_1 -onb&lt;BR /&gt;Now one user request that he must print his file to lj5_1 &amp;amp; lj5_2, so how can I make "UNIX-Command" for this task?&lt;BR /&gt;&lt;BR /&gt;Very sorry for my poor English!</description>
      <pubDate>Fri, 26 Dec 2003 03:23:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pipe-for-multiple-printer/m-p/3152534#M157828</guid>
      <dc:creator>Fragon</dc:creator>
      <dc:date>2003-12-26T03:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Pipe for multiple printer!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pipe-for-multiple-printer/m-p/3152535#M157829</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;my suggestion, if works the way you think.&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&amp;gt; /tmp/${$}.tempout&lt;BR /&gt;while read LINE&lt;BR /&gt;do&lt;BR /&gt;echo ${LINE} &amp;gt;&amp;gt; /tmp/${$}.tempout&lt;BR /&gt;done&lt;BR /&gt;lp -d printer1 /tmp/${$}.tempout&lt;BR /&gt;lp -d printer2 /tmp/${$}.tempout&lt;BR /&gt;lp -d printer3 /tmp/${$}.tempout&lt;BR /&gt;rm /tmp/${$}.tempout&lt;BR /&gt;&lt;BR /&gt;if the programme just uses lp -d lj5_1 -onb&lt;BR /&gt;with the file to print as parameter:&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;lp -d printer1 ${1}&lt;BR /&gt;lp -d printer2 ${1}&lt;BR /&gt;lp -d printer3 ${1}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Dec 2003 08:29:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pipe-for-multiple-printer/m-p/3152535#M157829</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-26T08:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Pipe for multiple printer!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pipe-for-multiple-printer/m-p/3152536#M157830</link>
      <description>Hi Michael , thank you very much for your reply!&lt;BR /&gt;But I think it won't work!&lt;BR /&gt;When use a shell program , it will replace the whole shell to the "UNIX-Command" , just like this:&lt;BR /&gt;# more jobs|#/usr/bin/ksh while read ....&lt;BR /&gt;Of course this can't work!&lt;BR /&gt;I'm not sure if this will work:&lt;BR /&gt;# more jobs|lp -d lj5_1|lp -d lj5_2 &lt;BR /&gt;&lt;BR /&gt;Any other ideas ?&lt;BR /&gt;Thank in advanced!</description>
      <pubDate>Fri, 26 Dec 2003 19:21:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pipe-for-multiple-printer/m-p/3152536#M157830</guid>
      <dc:creator>Fragon</dc:creator>
      <dc:date>2003-12-26T19:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Pipe for multiple printer!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pipe-for-multiple-printer/m-p/3152537#M157831</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;why do you think, it copies the contents of the file to the command line? It cant do it with the lp command, because thats a binary file. Anyway, you may try to trick it by using two shells. One you specify in the configuration, which has just one line:&lt;BR /&gt;. ./second_script&lt;BR /&gt;In case it copies the contents of the first script, it gets only this line and the rest is in script 2.&lt;BR /&gt;&lt;BR /&gt;have fun,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Sat, 27 Dec 2003 06:07:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pipe-for-multiple-printer/m-p/3152537#M157831</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-27T06:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Pipe for multiple printer!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pipe-for-multiple-printer/m-p/3152538#M157832</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I can't find any way to specify multiple printers from the command line. My first idea was if "tee" could be used but, it only works with files. There is an enhanced version of tee (xtee) avialable as freeware which  can use pipelines. I have not used it myself but it may be an idea. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://chasseur.usc.edu/pups/manPages/pupsManPages/xtee.1.html#lbAB" target="_blank"&gt;http://chasseur.usc.edu/pups/manPages/pupsManPages/xtee.1.html#lbAB&lt;/A&gt;</description>
      <pubDate>Sun, 28 Dec 2003 09:56:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pipe-for-multiple-printer/m-p/3152538#M157832</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2003-12-28T09:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Pipe for multiple printer!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pipe-for-multiple-printer/m-p/3152539#M157833</link>
      <description>Hi Z,&lt;BR /&gt;&lt;BR /&gt;Define a new application printer definition for both unix printers that uses the script below.&lt;BR /&gt;&lt;BR /&gt;printer-name unix-command&lt;BR /&gt;lp5acc-pur   /path/to/script '-dlp5acc -o"nb land c"' '-dlp5pur -onb -oland -oc'&lt;BR /&gt;&lt;BR /&gt;Yes, each printer name and its options are single-quoted together... Do not forget to use -d and -o appropriately. Notice how the options of the first printer are double-quoted within the single-quotes. The second printer separates its options so double-quotes are not needed.&lt;BR /&gt;&lt;BR /&gt;The script:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;mytmp=/tmp/${0##*/}.$$&lt;BR /&gt;trap "rm -f $mytmp" EXIT&lt;BR /&gt;cat - &amp;gt; $mytmp&lt;BR /&gt;if [ -s $mytmp ]&lt;BR /&gt;then&lt;BR /&gt;        for p in "$@"&lt;BR /&gt;        do&lt;BR /&gt;                eval lp $p $mytmp&lt;BR /&gt;        done&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;To preserve the quoting of each printer argument, it is important to double-quote "$@" in the for loop and to use eval to prepare the commandline for lp.&lt;BR /&gt;&lt;BR /&gt;Notice that "cat" is used to slurp the standard input to a temp file. This means that the script is intended to be used in a pipeline, or a single file must be redirected as standard input.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Dec 2003 11:57:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pipe-for-multiple-printer/m-p/3152539#M157833</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2003-12-29T11:57:54Z</dc:date>
    </item>
  </channel>
</rss>

