#!/bin/bash ak-extract-cids > to_stats sum=0 ; while IFS="" read -r p || [ -n "$p" ] do if [ "$p" != "" ] then num=$(ak-ipfs-block-stat $p | grep Size | sed -e 's/Size: //g') else num=0 fi sum=$(expr $sum + $num ) done < to_stats echo "Chain is : $sum bytes" rm to_stats