Another way of doing it would be to split the output on \s+, then collect the parts that you want.my $uptime = `uptime`; if ($uptime =~ /^\s+\S+\s+up\s+(\S+\s+\S+,\s+\S+),/) { print $1; } else { print "uptime gave me a weird format!"; }
In reply to Re: parsing output of uptime
by btrott
in thread parsing output of uptime
by mattman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |