in reply to split question
system will display the command output on the console. You want backticks (documented under Quote and Quote like Operators in perlop) that will capture the output to a variable:
for ( `lspv -l vpath0` ) { print +(split)[4], "\n"; }
but that's going to include the first two lines of the output, which you don't(?) want. So pipe the output of the command to perl:
open my $output, "lspv -l vpath0 |" or die $!; <$output>; # discard first <$output>; # two lines for ( <$output> ) { print +(split)[4], "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: split question
by mikejones (Scribe) on Nov 13, 2007 at 18:47 UTC |