#!/bin/sh if [ $# -eq 0 ]; then echo "usage: primwc files" >&2 exit1 fi j=`( for i do echo "$i" done )` for i in $j ; do if [ -f $i ]; then c="`cat -n $i | tail -n 1`" set $c echo "The answer is $i $1" else echo "File not valid" fi done