Rob E McCormick wrote:
>
> 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`);
The back-ticks (``) execute the program (/usr/bin/df -k) and return the
standard output of this program which you then try to execute with the
system function.
my @results = `/usr/bin/df -k`; # all output to array
# OR
my $results = `/usr/bin/df -k`; # all output to scalar
> 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
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]