Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 09-09-2014, 05:44 PM   #1
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)
_now=$(date +"%Y_%m_%d")

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

Can't stat No such file or directory 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
Registered: Mar 2009
Distribution: CentOS 6.5 / 7
Posts: 119

Original Poster
Rep: Reputation: 1

forgot the -- before the email address

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


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 > Forums > Linux Forums > Linux - Software

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

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