to 大狂: ; init 0;如果是一個套件我搜不到,但找到一個叫「sleepenh」套件它的簡要說明是:Sleep until a given date with subsecond resolution sleepenh is an sleep program for using in shell scripts that need to perform a loop that repeats at a regular time interval, without cumulative errors.
It supports microsecond resolution.
You can also specify the time you need between two calls of sleepenh.
Here follows an usage example to clarify its purpose. This example sends 'A' to ttyS0 every 1.2 seconds. #!/bin/sh # does not wait (or wait 0), just to get initial timestamp TIMESTAMP=`sleepenh 0` while true; do # send the byte to ttyS0 echo -n "A" > /dev/ttyS0; # wait until the required time TIMESTAMP=`sleepenh $TIMESTAMP 1.200`; done
For more details, please read the manpage. 也許是我套件庫中沒有來此套件之來源?
# apt-get upgrade ; init 0;
回覆刪除我一般都這樣做的,cron job有個風險,就是你預定的時間可能還沒更新完。
to 大狂:
回覆刪除; init 0;如果是一個套件我搜不到,但找到一個叫「sleepenh」套件它的簡要說明是:Sleep until a given date with subsecond resolution
sleepenh is an sleep program for using in shell scripts
that need to perform a loop that repeats at a regular
time interval, without cumulative errors.
It supports microsecond resolution.
You can also specify the time you need between two calls
of sleepenh.
Here follows an usage example to clarify its purpose. This
example sends 'A' to ttyS0 every 1.2 seconds.
#!/bin/sh
# does not wait (or wait 0), just to get initial timestamp
TIMESTAMP=`sleepenh 0`
while true; do
# send the byte to ttyS0
echo -n "A" > /dev/ttyS0;
# wait until the required time
TIMESTAMP=`sleepenh $TIMESTAMP 1.200`;
done
For more details, please read the manpage.
也許是我套件庫中沒有來此套件之來源?