Advertisement

04.06.2008 at 06:11AM PDT, ID: 23299410
[x]
Attachment Details

Mailing using perl script

Asked by rdashokraj in Perl Programming Language

Hello,

Referring to this Solution,
http://www.experts-exchange.com/Programming/Languages/Scripting/Perl/Q_23298404.html,

I tried to add one new feature to this script but got stuck. Please look at the code given in the snippet. Basically am trying to email the output file (/var/NetApp_scripts/reports/$hstnm".strftime"-%b-%d-%Y",'.txt') using 'uuencode' command. But that's not happening. I'm just receiving the mail with the subject "<Hostname> NetApp filesystem report" but with no attachment. While executing the command, it gives me a error saying "Bad name after txt' at ./result.pl line 15" or it gives "No such file" error.

Could you please look into it and correct for me?

Thanks,
Ashok

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
#!/usr/bin/perl
use POSIX;
 
$hstname = `hostname`;
chomp($hstnm);
 
open STDOUT,">/var/NetApp_scripts/reports/$hstname".strftime"-%b-%d-%Y".'.txt',localtime or die $!;
/\S/ && !/^==>/ && print while <>;
 
system('/usr/bin/uuencode ""/var/NetApp_scripts/reports/$hstname".strftime"-%b-%d-%Y".'.txt',localtime" $hstname".strftime"-%b-%d-%Y".'.txt' | mailx -s "$hstname NetApp filesystem report" ashok@domainname.com');
[+][-]04.06.2008 at 08:49AM PDT, ID: 21292162

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.06.2008 at 08:53AM PDT, ID: 21292175

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.06.2008 at 09:20AM PDT, ID: 21292274

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Sign Up Now!
Solution Provided By: FishMonger
Participating Experts: 1
Solution Grade: B
 
 
[+][-]04.07.2008 at 10:57PM PDT, ID: 21302887

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628