#!/bin/bash function input { echo abc echo ----- echo def echo ----- echo ghi echo ----- echo jkl echo ----- echo def echo ----- echo jkl echo ----- echo jkl } result=$(input | ./dedup-notes) if [ $(echo "$result" | wc -l) != 7 ] then : else echo "$0: Incorrect number of outputs" 1>&2 echo "$result" 1>&2 exit 1 fi