From 76d6fefeea93acaca4d81e1f28e54f06e3c1659e Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Sun, 9 Jul 2017 16:36:04 +0700 Subject: [PATCH] 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. --- neofetch | 1 + 1 file changed, 1 insertion(+) diff --git a/neofetch b/neofetch index aaa24717..ba537bd0 100755 --- a/neofetch +++ b/neofetch @@ -395,6 +395,7 @@ get_uptime() { d="0" h="0" case "$t" in *"-"*) d="${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#*:}))" ;; esac