7

Uptime (english & german)

Posted in System by Fussel 3622 days ago

Simply display the time your System is running… running… running…

In English
and German
(easy to modify)

Screenshot

Geeklet files to download

Comments

User Avatar
boissonnfive 3355 days ago
Hello Fussel, it doesn't work perfectly:

$ uptime

12:44 up 4:28, 2 users, load averages: 2,80 2,46 2,30

$ uptime | awk '{sub(/[0-9]|user,|users,|load/, "", $6); sub(/mins,|min,/, "min", $6); sub(",", "min", $5); sub(":", "h ", $5); sub(/mins,|min,/, "min", $4); ; sub(" h ", " h ", $4); sub(/days,/, "days ", $4); sub(/days,/, "days ", $4); sub(":", "h ", $3); sub(",", "min", $3); print $3 $4 $5 $6 " awake"}' | sed -e 's/1days/1day /g' -e 's/min1/min/g' -e 's/usermin//g'

4h 28min2usersmin awake

I did this:

uptime | awk '{sub(/[0-9]|user,|users,|load/, "", $6); sub(/mins,|min,/, "min", $6); sub(",", "min", $5); sub(":", "h ", $5); sub(/mins,|min,/, "min", $4); ; sub(" h ", " h ", $4); sub(/days,/, "days ", $4); sub(/days,/, "days ", $4); sub(":", "h ", $3); sub(",", "min", $3); print $3 $4 $5 $6 " awake"}' | sed -e 's/1days/1day /g' -Ee 's/[0-9][1-9]?user[s]?min//g'

and it worked for me.

Thank you anyway.

Boissonnfive.
User Avatar
maddagu 3169 days ago
@boissonnfive cool stuff

Log in to comment or register here.