pr and lpr combination command

Han Tin HTin at HaddonHouse.com
Wed Sep 21 11:13:52 UTC 2005


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

-----Original Message-----
From: Alfred Hovdestad [mailto:alfred.hovdestad at usask.ca]
Sent: Tuesday, September 20, 2005 6:00 PM
To: General Red Hat Linux discussion list
Subject: Re: pr and lpr combination command


#!/bin/sh
pr $1 | lpr



Han Tin wrote:
> To all,
> I am new to Linux (RH) and I am trying to print my programs using pr.
> Anyone out there has script written for that. 
> I have posted, no response. 
> Thanks in advance.
> Han
> Haddon House Foods Products, Inc.
> Medford, NJ.
> 

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list




More information about the redhat-list mailing list