Uptime [AIX/IRIX]: Remove leading zeroes from output
From bash(1): > Constants with a leading 0 are interpreted as octal numbers. A > leading 0x or 0X denote hexadecimal. This causes error in uptime calculation.
This commit is contained in:
parent
e9f491656e
commit
76d6fefeea
1 changed files with 1 additions and 0 deletions
1
neofetch
1
neofetch
|
@ -395,6 +395,7 @@ get_uptime() {
|
||||||
d="0" h="0"
|
d="0" h="0"
|
||||||
case "$t" in *"-"*) d="${t%%-*}"; t="${t#*-}";; esac
|
case "$t" in *"-"*) d="${t%%-*}"; t="${t#*-}";; esac
|
||||||
case "$t" in *":"*":"*) h="${t%%:*}"; t="${t#*:}";; esac
|
case "$t" in *":"*":"*) h="${t%%:*}"; t="${t#*:}";; esac
|
||||||
|
h="${h#0}" t="${t#0}"
|
||||||
seconds="$((d*86400 + h*3600 + ${t%%:*}*60 + ${t#*:}))"
|
seconds="$((d*86400 + h*3600 + ${t%%:*}*60 + ${t#*:}))"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue