Need to find out what's going on in the last line

November 30, 2012 at 16:43:50
Specs: Windows 7

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 ]
echo "Usage: middle <start line number> <end line number> <filename>"

# note that $1 is the first command line argument,
# $2 is the second argument, so on...

head -$2 $3 | tail -`expr $2 - $1 + 1`

See More: Need to find out whats going on in the last line

Report •

November 30, 2012 at 21:03:08

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

Report •

December 1, 2012 at 13:11:51

I missed a few weeks of class due to illness just trying to catch up! Missed a lot of information then too!

Report •

Related Solutions

Ask Question