View Single Post
Win7Mac's Avatar
Community Council | Posts: 664 | Thanked: 1,648 times | Joined on Apr 2012 @ Hamburg
#567
Originally Posted by thedead1440 View Post
Code:
#!/bin/sh
#uptime

days=$(cat /proc/uptime | awk '{print $1}')
days2=`dc $days 86400 / p | cut -c1-4`
days3=`dc $days 86400 / p | awk -F"." '{print $1}'`

if [ $days3 -lt 10 ]
then
echo -n -e up\: $days2 
else 
echo -n -e up\: $days3
fi
echo -n -e  "\xe2\x98\xA2"
It requires dc to work but IIRC dc is by default present...
Yes, it requires dc which is not preinstalled.
Can't install it now, because "Recource temporarily unavailable".

But the python version works right out of the box.
Thank you guys!
__________________
Nokia 5110 > 3310 > 6230 > N70 > N9 BLACK 64GB
Hildon Foundation Board member
Maemo Community e.V. co-creator, founder and director since Q4/2016
Current Maemo Community Council member