My pipe has two fgrep's and two wc's. Maybe think about this progression: cal | wc -l cal | wc -l | wc -l