#!/bin/sh # sum the byte size of files at paths read from standard input. total=0 while read line do set -- $(du "$line") total=$(($total + $1)) done echo $total