Hi!

I would like to grab the first column (variable width) of data in each
line that will be returned from an external command.
I tried @PSARRAY = `command | grep bf1`; and got just the lines with
data I wanted.  The returned data looks like this:

EHCFS001   Booted     Down  bf1/p20   Windows/MU    Yes,Opt,0 12:55:29
VMDFS      Booted     Up    bf1/p14   VM25AS21e16/MU Yes,Opt,0
12:52:12
ORA_1      Booted     Up    bf1/p18   VM25AS21e16/MU Yes,Opt,0
12:56:25
ps3        Booted     Up    bf1/p3    custom/MU     Yes,Opt,0 12:51:56
ps4        Booted     Up    bf1/p4    custom/MU     Yes,Opt,0 12:51:42
ps5        Booted     Up    bf1/p5    custom/MU     Yes,Opt,0 12:51:22

I need to capture just EHCFS001, VMDFS, ORA_1, PS3, PS4 and PS5  in a
var, array, hash, whatever and I don't care about any of the other data.
 A variable would be preferable over array, I think.

I then tried @PSARRAY = `command | grep bf1 | awk -F " " '{print $1}'`
but got the same exact results.  Anyone know why it didn't like the awk
command or just decided to ignore it?
If I run command | grep bf1 | awk -F " " '{print $1}' on the command
line I get exactly what I need, why doesn't this work during an external
call?

Running on Linux, Perl 5.6.1

Thanks all.



Bill Akins
SSS III
Emory Healthcare
(404) 712-2879 - Office
12674 - PIC
[EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to