On Jul 29, Jean Berthold said:
>open( FH_DF, system( "df -k -F ufs | cut -c 56-100" ) ) ;
open() doesn't work like that. Or, more to the point, system() doesn't
work like that. system() executes a command, and anything the commands
prints gets printed. You want:
open FH_DF, "df -k -F ufs | cut -c 56-100 |" or
die "can't run command: $!";
>while ( <FH_DF> )
>{
> $Slices{$key} = '$_' ;
>}
Where does $key come from? And why did you put $_ in single quotes?
Remove the quotes around $_. And figure out what $key is.
>for example, second loop :
>while ($key) = each %Slice )
>{
> $Slice{$value} = `fssnap -i $key | grep /dev/fssnap | cut -c 33-45` ;
>}
Where did $value come from? And you're missing a '(' on your while loop.
Perhaps you wanted to do:
while (<FH_DF>) {
chomp; # remove newline
$Slices{$_} = `fssnap -i $_ | grep /dev/fssnap | cut -c 33-45`;
}
Although you could really use substr() instead of calling cut.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
[ I'm looking for programming work. If you like my work, let me know. ]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]