1 Star 0 Fork 0

AxYiXiao/OneLifeData7

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
printContainerObjects.sh 824 Bytes
一键复制 编辑 原始数据 按行查看 历史
for f in `ls -v objects/*`; do
if [[ $f == objects/*.txt ]] && ! [[ $f == objects/nextObjectNumber.txt ]];
then
name=$(cat $f | sed -n 2p );
containable=$(cat $f | sed -n 3p );
containSize=$(cat $f | sed -n 4p );
cont=$(echo $containable | grep -o -E '[01]' | head -1 );
containableSize=$(echo $containSize | grep -o -E '[0-9]' | head -1 );
numSlots=0;
slotSize=0;
while read -r line
do
if [[ $line == numSlots* ]];
then
numSlots=$(echo $line | grep -o -E '[0-9]' | head -1 );
fi
if [[ $line == slotSize* ]];
then
slotSize=$(echo $line | grep -o -E '[0-9]' | head -1 );
fi
done < $f
if (( $(bc <<< "$numSlots > 0") ))
then
echo -n -e "$name\n | $numSlots slots, size = $slotSize"
if (( $(bc <<< "$containable > 0") ))
then
echo -n -e "\n | containableSize = $containableSize"
fi
echo ""
fi
fi
done
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/axyixiao/OneLifeData7.git
git@gitee.com:axyixiao/OneLifeData7.git
axyixiao
OneLifeData7
OneLifeData7
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385