最近看了一本shell脚本攻略 是一个21岁的在校大学生写的,除了编写了此书,他还是SLYNUX GNU/linux 发行版的研发人员,说来我也21岁了 惭愧啊
使用tput和sleep从0开始计数到40:
shell脚本
#!/bin/bash
echo -n Count:
tput sc
count=0
while true
do
if [ $count -lt 40 ];
then
let count++
sleep 1;
tput rc
tput ed
echo -n $count
else
exit 0;
fi
done