Re: how can i send an attached file from command line?
- From: Douglas Mayne <doug@xxxxxxxxxxxxxxxxx>
- Date: Wed, 14 Feb 2007 07:37:31 -0700
On Tue, 13 Feb 2007 23:33:27 -0800, rh00667 wrote:
hi,On my system mail is a symbolic link to nail. nail's "-a" flag specifies
i need to "cron" a mail attaching a binary file. i am using
uuencode file | mail -s subject destination
uuencode now is not in standard packages, so i compiled it.
is there another easier form to do this?
tia
a file to attach; man nail
The other part of nail's behavior, which you are getting around using a
pipe, is that it expects the body of the message on the command line,
terminating with a CTRL-D. Here are a couple of alternatives.
You can keep using a pipe:
echo 'Job at $(date)' | mail -s subject -a file someone@localhost
or, use a "HERE" document:
mail -s "Job at $(date "+%Y%m%d.%H%M%S")" -a somefile \
someone@localhost <<EOM
EOM
Verify any of the above commands are appropriate for your system.
Going offtopic...
There is one other minor glitch when using multiple line commands when
using "at" instead of "cron." IIRC, cron requires encapsulation of jobs
into scripts which are executed on a recurring time interval. "at" has a
more flexible execution schedule: "at" jobs execute once at the time
specified. If the job consists of multiple commands then it is simpler to
put all of the commands into a simple script, too. That avoids
unnecessarily complex command lines.
--
Douglas Mayne
.
- Follow-Ups:
- Re: how can i send an attached file from command line?
- From: Grant Edwards
- Re: how can i send an attached file from command line?
- References:
- how can i send an attached file from command line?
- From: rh00667
- how can i send an attached file from command line?
- Prev by Date: Re: how can i send an attached file from command line?
- Next by Date: Re: how can i send an attached file from command line?
- Previous by thread: Re: how can i send an attached file from command line?
- Next by thread: Re: how can i send an attached file from command line?
- Index(es):
Relevant Pages
|