您现在的位置是:网站首页> 编程资料编程资料
shell脚本实现拷贝大文件显示百分比的代码分享_linux shell_
2023-05-26
326人已围观
简介 shell脚本实现拷贝大文件显示百分比的代码分享_linux shell_
复制代码 代码如下:
#!/bin/sh
strace -q -eread cp -- "${1}" "${2}" 2>&1 \
| awk '{
count += $NF
if (count % 10 == 0) {
percent = count / total_size * 100
for (i=0;i<=percent;i++)
printf("=");
printf(">");
printf ("%2.0f%%\r", percent);
}
}
END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
您可能感兴趣的文章:
相关内容
- Shell脚本实现自动发送邮件的例子_linux shell_
- 自己常用的一些shell脚本分享_linux shell_
- awk中实现ord函数功能_linux shell_
- CentOS下redis自启动shell脚本_linux shell_
- 收集的48个Shell脚本小技巧_linux shell_
- shell脚本连接、读写、操作mysql数据库实例_linux shell_
- Shell+Linux命令实现日志分析_linux shell_
- Linux中执行shell脚本的4种方法总结_linux shell_
- Shell脚本读取ini配置文件的实现代码2例_linux shell_
- 使用iconv批量改变文件编码的shell脚本_linux shell_
