2012-10-31 24 views

回答

1

是這樣的?

#!/bin/sh 
while true 
do 
    cat /proc/stat > /some/file 
    sleep 3 
done 

/path/to/scrip.sh &

運行它(使用後&在後臺運行,那就是:「守護」模式)

這不是很複雜(例如只AWY到一旦它開始就停止它是通過殺死它),但做你的要求。

+0

作品令人驚歎,謝謝 – stix

+0

'while sleep 3' works as well。 – InternetSeriousBusiness