#!/bin/sh # Output top ten most freq words (with counts) separately for each file. for i ## With no "in" clause this means: for i in "$@" do if [ -r "$i" ] ; then ## check to see if file readable echo $i: ## print name of file freq $i | head ## give top ten else ## file does not exist, print message echo >&2 `basename $0`: bad file argument: "$i" # exit 1 ## uncomment if missing files should be fatal fi done