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