Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing ps time

Status
Not open for further replies.

Omnillas

Programmer
May 4, 2004
29
US
What's a good way to break up the time values returned in your average BSD-styled ps? The format is generally dd-hh:mm:ss.ss. As you know, the days portion is not always populated if days haven't accumulated depending on the aspect of time we are looking at (ie, etime, cputime, etc.).
 
I'm confused.. you just want to split the time up? check out split :)
for my $line (@psoutput){
my @data = split(/\:/, $line):
}



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top