[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Send output to file & printer



On Fri, Jan 30, 2004 at 05:26:08PM -0500, Adam Aube wrote:
| On Friday 30 January 2004 04:59 pm, James Horvath wrote:
| > Not new to linux per say, but have done almost no shell scripting or
| > programming with it, so consider me a complete rookie.
| 
| There are probably some good shell scripting HOWTOs you could find using 
| Google.
| 
| > Using lpd, is there a simple way using the command line to send the
| > output of a process to both a file and a printer at the same time?
| 
| I believe the "tee" command does something like this - see its man page.

It does.  For example :

    $ echo 'Hello World!' | tee /tmp/A_File | lp

| > Optionally, how might I go about saving a copy of a print job to file
| > before it prints (without disabling the print queue itself)?
| > As an example, if I issue a command like "ls -laF" on a directory

    ls -laF | tee /tmp/listing | lp

-D

-- 
Religion that God our Father accepts as pure and faultless is this: to
look after orphans and widows in their distress and to keep oneself from
being polluted by the world.
        James 1:27
 
www: http://dman13.dyndns.org/~dman/            jabber: dman@dman13.dyndns.org

Attachment: signature.asc
Description: Digital signature


Reply to: