Bash script, Illegal number: 08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm running a pretty simple bash script in ubuntu but have come up with a problem. If needed I'll post the whole script, but I've narrowed down the problem. Basically, I want to run some code every 15 seconds, so I started with this: time=`date +%S` time2=$((time%15)) if [ $time2 -eq 0 ] then etc, etc, etc.... The problem comes up when time is 08 seconds. The script terminates with Illegal number: 08. Adding to that, when using: time2=$(($time%15)) instead of the illegal number error, it would terminate with Arithmetic expression: expecting