看微博上大家在搞就搞了一个
#!/bin/bash
stty erase ^H
echo -e "\e[1;31m欢迎使用铁路客运服务中心\e[m"
echo "======================="
echo -e -n "\e[1;34m用户名:\e[m"
read
echo -e -n "\e[1;34m密码:\e[m"
echo -e "\n=======================\n"
}
wait_2m(){
second=120
length=240
while [ $second -gt 0 ]
do
sleep 1;
second=$((second -1 ))
length=$((length -2 ))
echo -e -n "\r您前面还有\e[1;32m$length\e[m人在等待,您还需要等待\e[32m$second\e[m秒"
done
echo -e "\e[1;32m\n恭喜您,轮到您购票了!\e[m"
}
hello
wait_2m
运行示范
阅读(578) | 评论(0) | 转发(0) |