#!/bin/sh # Here-documents: 2000 bodies, each read back with the read builtin. i=0 n=0 while [ $i -lt 6000 ]; do while read -r a; do n=$((n + ${#a})); done <