|
|
| XP is just a number | |
| PerlMonks |
A small queestion to match processesby heatblazer (Scribe) |
| on Oct 05, 2012 at 18:23 UTC ( #997529=perlquestion: print w/ replies, xml ) | Need Help?? |
heatblazer has asked for the
wisdom of the Perl Monks concerning the following question:
Hello, monksI have a fast question: I want to match unix`s ps aux, and I have some idea I realized and it is working, I am just wondering if the approach is good, decent or poor noob-a-like.
Any better ideas will be most appriciated. But not too advanced stuff since I am still a newbie. UpdateI was able to parse "top" command too assigning it to a dseired by me hash. Here is the codeblock:
Hope that some UNIX sys admins will benefit from the idea and the code. You won`t see anything in the terminal, just press 'Q' sometime to see the hash assignment. It`s a baby code and there can be many options to it. If I get better I`ll definitely modularize it and hope to help some world`s problems. P.S. I had no idea that parsing TOP is actually not exactly what you think and what you see in the terminal. After top >> top.log and review it in texteditor I saw many control characters so /^(\d+)\s/ never worked since no new line began with a digit but a control character!!! Awesomely godness! Never knew that stuff!
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||