You have gotten lots of suggestions about the system call etc. So I do not
have much to say about that other than to point out that the code you have
written is not very portable (since it relies on the unix command df). If you
want a platform independent solution there is a perl alternative to
I think output is lost with system - maybe
my $results = `$cmd`;
Also the print is not needed before the EOF.
At Monday, 28 January 2002, "McCormick, Rob E" wrote:
>Gang,
>
>Using 'df -k' in bash, I can get this to work acceptably:
>
># mail the disk usage for a file system to a recipient 'ui
Hi Rob,
You don't need to put the system call in backticks. You could just do
$result = `some command`;
to get the output of the command stored as a multiline string in $result.
system() does not store the output of the command, only the exit status of
the command you have called.
I d
Rob E McCormick wrote:
>
> Thanks for the prompt repliesmy 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 indica
Thanks for the prompt repliesmy 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 )
Update
rom: McCormick, Rob E [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 28, 2002 5:29 PM
To: perl beginners (E-mail)
Subject: mailing captured output with template text
Gang,
Using 'df -k' in bash, I can get this to work acceptably:
# mail the disk usage for a file system to a recipien
Gang,
Using 'df -k' in bash, I can get this to work acceptably:
# mail the disk usage for a file system to a recipient 'uid'
df -k /data/wrc |mailx -s 'host disk usage' [EMAIL PROTECTED]
I'd like to use perl to surround the output of df -k with a simple text
message. I used perldoc -q mail to