1 Star 4 Fork 1

QimingYe/chia

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
plot_status 896 Bytes
一键复制 编辑 原始数据 按行查看 历史
QimingYe 提交于 2021-05-02 22:52 +08:00 . Add file "plot_status".
#! /bin/bash
# --------------------------------------------------------------------------
#
# This script checks the status of plotting on the command line.
#
#
# 04/30/21
#
# --------------------------------------------------------------------------
[ $# -lt 1 ] && { echo "Usage ${0} [log file(s)]" ; exit 1 ; }
# This number is what chia-blockchain-gui use.
MAGIC_NUM=2626
for log_file in $@ ; do
[ -f "${log_file}" ] || \
{ echo "Log file: ${log_file} is not a file." ; continue ; }
[ -r "${log_file}" ] || \
{ echo "Log file: ${log_file} is inaccessible." ; continue ; }
log_lines=$(wc -l ${log_file} | awk '{ print $1 }')
[ $log_lines -gt $MAGIC_NUM ] && \
{ echo -e "$log_file\t100%" ; continue ; }
percentage=$(echo $(echo "scale = 3 ; ${log_lines} / ${MAGIC_NUM} * 100" | bc)%)
echo -e "$log_file\t$percentage"
done
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/procleaf/chia.git
[email protected]:procleaf/chia.git
procleaf
chia
chia
master

搜索帮助