in reply to Re: Parsing 'uptime' output
in thread Parsing 'uptime' output

Careful. uptime's output is dependent on how much time has passed. The .+? days bit may not always be there for example. That's why I, in general, would agree with rob_au on getting the information from a more friendly interface - of course, the caveats sauoq mentioned apply here. Choose your poison.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re^2: Parsing 'uptime' output
by BrowserUk (Patriarch) on Aug 19, 2002 at 05:08 UTC

    Valid point, but as someone's sig. reads: "Teach a man to fish...".

    I did mention that my testing was based upon his sample uptime output. Maybe I should have also said that if the format of the output varies from that (more than the pluralisation of day(s) and user(s)), he will have to read perlre and/or perlretut to work out how to adjust it further.


    What's this about a "crooked mitre"? I'm good at woodwork!