pr and lpr combination command

Alfred Hovdestad alfred.hovdestad at usask.ca
Wed Sep 21 17:36:52 UTC 2005


man lpr


        -P destination
             Prints files to the named printer.


    Alfred


Han Tin wrote:
> Hi Alfred,
> This is the shell scripts, I used in HP-UX.
> 
> #!/usr/bin/ksh
> # file : proglist
> # desc : pr formatting and hp laser portrait condense code
> # by   : Han Tin
> # usage: proglist <file1> ... <filen> | lp -d <printer>
> # usage: <program> | proglist | lp -d <printer>
> # ex.  : proglist `pwd`/file1 `pwd`/file2 | lp -d mis_laser
> #      : ls -al | proglist | lp -d mis_laser
> #---------------------------------------------------------------------
> echo "^[&k2S^[&l5C\c"
> (
> if [ "$#" -eq 0 ]
> then
>   cat | pr -n -o20 -w100 -l98 -f $1
> else
>   pr -n -o20 -w100 -l98 -f "$@"
> fi
> ) | crlf
> 
> 
> usage:
> proglist <file1> ... <filen> | lp -d <printer>
> 
> 
> According to yours, I create a file called  prt.
> 
> #!/bin/sh
> # prt
> pr -n -o20 -w100 -l98 -f $1 | lpr -d picshp
> 
> It gave me the following message. What need to be done. Your help is
> appreciated in advance.
> 
> $ prt prt|lp -dpicshp
> Warning - Cannot open file 'picshp', No such file or directory
> picshp: nothing to print
> 




More information about the redhat-list mailing list