script called middle. Usage is given within the script itself. Show a few sample runs, and also explain
what is going on in the last line.
#! /bin/bash
# check # of command line arguments
if [ $# -lt 3 ]
then
echo "Usage: middle <start line number> <end line number> <filename>"
exit
fi# note that $1 is the first command line argument,
# $2 is the second argument, so on...head -$2 $3 | tail -`expr $2 - $1 + 1`
Wow! you won't find home work much easier than this! The instructor gives you the script and you're too lazy to run the script yourself?? man head
man tail
man expr
I missed a few weeks of class due to illness just trying to catch up! Missed a lot of information then too!
