LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-09-2014, 05:44 PM   #1
thealmightyos
Member
 
Registered: Mar 2009
Distribution: CentOS 6.5 / 7
Posts: 119

Rep: Reputation: 1
need help w/script using variable to send attachment via mutt


I created two scripts. The firsts collects a lot of data and orginizes it just the way my boss wants it. That one works great. Now I want to save the output to a dated file, print out that file and email it to me as an attachment so I can look it over and send it wherever it needs to go. Everything works fine but the email portion of the script

Here is the script (sans personal info)
Code:
#!/bin/bash
_now=$(date +"%Y_%m_%d")
_file="server_status_$_now.txt"

/home/user/reports/report.sh > /home/user/reports/"$_file" 
lp /home/user/reports/"$_file"
echo Status Report for "$_now" | mutt -a /home/user/reports/"$_file" -s "Status Reports" my.email@my.job
When I run this script I get a printout exactly how I want it, however, I also get an error message:

Code:
Can't stat my.email@my.job: No such file or directory
my.email@my.job: unable to attach file
I bet it is something stupid like I missed some quotation marks or a slash or something like that
 
Old 09-10-2014, 06:18 PM   #2
thealmightyos
Member
 
Registered: Mar 2009
Distribution: CentOS 6.5 / 7
Posts: 119

Original Poster
Rep: Reputation: 1
EDIT:

forgot the -- before the email address

Last edited by thealmightyos; 09-12-2014 at 07:21 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to strip attachment on server and send it to NAS Jzarecta Linux - Server 1 08-05-2013 03:04 PM
Mutt Html and attachment issue snagar Linux - Software 0 08-10-2008 09:58 AM
bash script to send a mail attachment aeby Linux - General 6 05-28-2007 06:13 AM
mutt zipped file name attachment ??? dainovka Linux - Software 0 03-16-2005 01:00 PM
howto send a mail with attachment via perl script ? cccc Programming 24 03-05-2004 07:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration