进度指示器
时间:2007-09-03 来源:codfei
INTERVAL=1
TCOUNT="0"
while :
do
TCOUNT=`expr $TCOUNT + 1`
case $TCOUNT in
"1") echo -e '-'"\b\c"
sleep $INTERVAL
;;
"2")echo -e '\\'"\b\c"
sleep $INTERVAL
;;
"3")echo -e "|\b\c"
sleep $INTERVAL
;;
"4")echo -e "/\b\c"
sleep $INTERVAL
;;
*) TCOUNT="0" ;;
esac
done
[root@localhost ~]# SECONDS=0
#中间停顿了12秒
[root@localhost ~]# echo $SECONDS
12
相关阅读 更多 +