Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: Parsing output from a command

by BrowserUk (Patriarch)
on Mar 24, 2009 at 18:33 UTC ( [id://752932]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Parsing output from a command
in thread Parsing output from a command

Hm. I got this output when I ran your code on the OP's data (c&p'd from the console window):

c:\test>junk4 hdisk0 0009E05B hdisk1 P1/Z1-Ab 16 Bit LVD SCSI Disk Drive (18200 MB) Manufacturer................IBM Machine Type and Model......ST318305LC FRU Number..................09P4437 Serial Number...............0004A0D2 Part Number.................09P4436

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^5: Parsing output from a command
by Limbic~Region (Chancellor) on Mar 24, 2009 at 19:06 UTC
    BrowserUk,
    The problem isn't what you suggest:
    That'll screw up on the last record because there is no "\nhdisk" delimiter following it.

    The problem is that the regex was anchored at ^. As I said, I had to make a minor modificiation to match the real AIX command (removing that). If you modify my code to drop the ^ it will work against the OP's DATA or the two modifications above if you want to run it on the real command.

    Cheers - L~R

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://752932]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-26 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found