how to generate progress in shell?
#!/bin/sh b='' for ((i=0;$i<=100;i+=2)) do printf "progress:[%-50s]%d%%\r" $b $i sleep 0.1 b=.$b done echo
运行结果为:
progress:[..................]100%
利用-\|/实现旋转滚动效果
#!/bin/bash i=0 while [ $i -lt 20 ] do for j in '-' '\' '|' '/' do printf "intel testing : %s\r" $j sleep 0.1 ((i++)) done done
相关推荐
liujia 2020-06-02
fgleeldq 2019-12-31
qianjq 2019-12-30
fengling 2019-12-30
playlinuxxx 2011-02-04
前端开发Kingcean 2019-10-28
Helene 2011-09-17
best0power 2015-03-16
小傻 2019-07-01
莲开十月人思量 2019-06-29
nicepainkiller 2019-06-29
yqoxygen 2019-06-29
椎锋陷陈 2012-06-07
Kindlecode 2014-07-07
vqudominiapp 2019-06-26
renpinghao 2019-06-26
永不放弃 2019-06-26
别告诉我有Bug 2011-04-25