[email protected]:/home/wideDB1$ echo $(($(date +%s%N)/1000000))
1441637184683
[email protected]:/home/wideDB1$ echo $(($(date +%N)/1000000))
730
[email protected]:/home/wideDB1$ echo $(($(date +%N)/1000))
bash: 088253206: value too great for base (error token is "088253206")
[email protected]:/home/wideDB1$ echo $(($(date +%N)/1000))
bash: 085061725: value too great for base (error token is "085061725")
[email protected]:/home/wideDB1$ echo $(($(date +%N)/10000))
59078
[email protected]:/home/wideDB1$ echo $(($(date +%N)/1000))
672523
[email protected]:/home/wideDB1$ echo $(($(date +%N)/10))
12079796
[email protected]:/home/wideDB1$ echo $(($(date +%N)/10000))
74644
[email protected]:/home/wideDB1$ echo $(($(date +%N)/100000))
1403
[email protected]:/home/wideDB1$ echo $(($(date +%N)/1000000))
5
[email protected]:/home/wideDB1$ echo $(($(date +%N)/100000))
9977
[email protected]:/home/wideDB1$ echo $(($(date +%N)/1000000))
360
[email protected]:/home/wideDB1$ echo $(($(date +%N)/100000))
6663
[email protected]:/home/wideDB1$ echo $(($(date +%N)/10))
10325856
[email protected]:/home/wideDB1$ echo $(($(date +%N)/100))
8020128
[email protected]:/home/wideDB1$ echo $(($(date +%N)/1000))
9461
[email protected]:/home/wideDB1$ echo $(($(date +%N)/10000))
81272
[email protected]:/home/wideDB1$ echo $(($(date +%N)/10000))
bash: 046340492: value too great for base (error token is "046340492")
我必須在bash腳本中準確地使用此功能來同步任務之間的毫秒數,但這裏非常不穩定。任何人都可以幫助我弄清楚這項工作的最佳解決方案?定期「價值太大基地」做日期輸出在數學上的數學
乾杯! 亞歷山德羅$((...))
內部
你得到的價值太大了'錯誤,因爲前面的零指示外殼的八進制數做算術時。你可以通過sed -E'/^0 //'來刪除它。 – user1666959
另請參閱http://wooledge.org/~greybot/meta/august –
@ user1666959,boo hiss re:建議調用一個外部工具來完成shell可以執行的操作。 –