#!/bin/sh if test $# -ne 3 then echo "Usage: middle-sh " exit fi length=`wc -l < $3` top=`expr $length - $2` bottom=`expr $top - $1` cat $3 | head -n $top | tail -$bottom