#!/bin/sh # TailMinus.sh # 2008-07-21 # Chieh Cheng # http://www.CynosureX.com/ # GNU General Public License (GPL) Version 2, June 1991 scriptName=`echo $0 | sed s/\\\\/.*\\\\///g` if [ $# -ne 2 ] then echo " Usage: ${scriptName} \"skip lines\" \"file\"" else skipLines=$1 file="$2" if [ -f "${file}" ] then lines=`cat "${file}" | wc -l` remain=`expr "${lines}" - ${skipLines}` if [ ${remain} -gt 0 ] then tail -${remain} "${file}" fi else echo "${file} not found!" fi fi