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

Re: Print & Email the same document



kmself@ix.netcom.com wrote:

> On Fri, Apr 21, 2000 at 11:16:59AM -0500, Kent West wrote:
> > I've been trying to do this off-and-on for two years, and although
> > I've had lots of help, nothing has ever worked. Can I assume that
> > it's impossible to print and email a document from one command?
>
> You've outline of a rather complicated method.  How about:
>
> cat <<EOF > /usr/local/bin/print-n-mail
> #!/bin/bash
> lpr \$@
> mail -s \"\$@\" \$USER < \$@
> EOF
>
> chmod +x /usr/local/bin/print-n-mail
>
> ...or how doesn't this fit the bill?
>
> I would in general avoid munging an existing utility which does one
> thing to make it do two.  Rather I'd write a new utility to combine the
> two existing ones.
>
> --
> Karsten M. Self <kmself@ix.netcom.com>           http:/www.netcom.com/~kmself

I might have left out detail that might prove to be important. This printer
queue will be shared over the network so that a 911 call notification server can
print to it, generating both the printout and an email and a beeper message (via
email). The 911 call notification server is running on a WindowsNT (gag, aack)
box. Currently, the 911 software can't print and email, so I wanted to bring
Linux into the picture to demonstrate to the big-whigs that Linux solves
problems. Only thing is, I've been trying for two years off-and-on to solve this
problem with no results.

The method you use seems to work for local command-line printing, but I'm having
trouble seeing how I can use it to allow a Windows box to print to it via the
network. But then, I'm a relative newbie to Linux, so I may be missing the
obvious.




Reply to: