On Mon, 2008-12-01 at 22:18 -0500, David wrote:
> Thank you to all who helped me get a 6 digit date into perl. I 
> certainly heed warnings about not using outside system calls in perl 
> however, I have to make an outside call again.
> 
> 
> 
> #!/usr/bin/perl -w
> use strict;
> 
> my $fileName = "081201 diskSpace.txt";
> my $fileLoc = "/Users/mini/diskSpaceLog/$fileName";
> system "(df -mg;) >$fileLoc &";
> 
> 
> 
> My problem is the last line. Output:
> sh: -c: line 1: syntax error near unexpected token `diskSpace.txt'
> sh: -c: line 1: `(df -mg;) >/Users/mini/diskSpaceLog/081201 diskSpace.txt &'
> 
> 
> I made sure to follow the Learning Perl code. It's just not working for me.

The problem is the space character in the file name.  Try:

system "(df -mg;) >\"$fileLoc\" &";




-- 
Just my 0.00000002 million dollars worth,
  Shawn

The key to success is being too stupid to realize you can fail.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to