Thanks for the prompt replies....my apologies, but I'm not grasping the
quoting problem(s) or another problem.....?

I revised the code to use an @array v. $scalar.  I also noticed I left out
the -odq option in the perldoc example, so inserted it (as docs indicate,
controls queuing/delay )

Updated script:

 1  #!/usr/bin/perl -w
 2  use strict;
 3
 4  my @results = system (`/usr/bin/df -k`);
 5
 6  open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq")
 7          or die "Can't fork for sendmail: $!\n";
 8  print SENDMAIL <<EOF;
 9  From: <uid\@host>
 10  To: <uid2\@host.com>
 11  Subject: host disk usage
 12
 13  host disk usage
 14  @results
 15  EOF
 16  close (SENDMAIL) or warn "sendmail didn't close nicely";

Result:
mail delivers, content is:

host disk usage
65280

on screen error is:
Can't exec "Filesystem            kbytes    used   avail capacity  Mounted
on
": No such file or directory at /opt/apps/webtrends/bin/diskusage line 4



> my @results = `/usr/bin/df -k`; # now stores all the lines of df -k
> # backticks seem to be working OK?
> 
> [snip]
> 
> #everything here is in double quotes until you see another EOF
> print SENDMAIL <<EOF;
> From: <uid\@host>
> To: <email_acct\@acme.com>
> Subject: host disk usage
> 
> host disk usage
> @results
> EOF
> 
> [snip]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to