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

Re: Print & Email the same document



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
    What part of "Gestalt" don't you understand?
    http://gestalt-system.sourceforge.net/
GPG fingerprint: F932 8B25 5FDD 2528 D595  DC61 3847 889F 55F2 B9B0

Attachment: pgpqE0HpHb5Xo.pgp
Description: PGP signature


Reply to: