【发布时间】:2017-09-05 03:48:58
【问题描述】:
我正在修改我在互联网上找到的一些东西来自定义我的 pi ssh 登录消息,但我最终遇到了错误。
以下是我的代码:
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
let secs=$((${upSeconds}%60))
let mins=$((${upSeconds}/60%60))
let hours=$((${upSeconds}/3600%24))
let days=$((${upSeconds}/86400))
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"`
let totalSpace="$(df -Bm | grep /dev/root | awk {'print $4'})"
let freeSpace="$(df -Bm | grep /dev/root | awk {'print $3'})"
TOTAL=`echo "$freeSpace Mb (Free) / $totalSpace (Total)"`
# get the load averages
read one five fifteen rest < /proc/loadavg
echo "$(tput setaf 2)
.~~. .~~. `date +"%A, %e %B %Y, %r"`
'. \ ' ' / .' `uname -srmo`$(tput setaf 1)
.~ .~~~..~.
: .~.'~'.~. : Uptime.............: ${UPTIME}
~ ( ) ( ) ~ Memory.............: ${TOTAL}
( : '~'.~.'~' : )
~ .~ ( ) ~. ~
( : '~' : )
'~ .~~~. ~'
'~'
$(tput sgr0)"
它返回这些错误,我不知道如何解决它们:
/home/pi/.bash_profile: line 8: let: totalSpace=12688M: value too great for base (error token is "12688M")
/home/pi/.bash_profile: line 9: let: freeSpace=1562M: value too great for base (error token is "1562M")
【问题讨论】: