1.

Write a shell script that accepts a file name, starting and ending line numbers as arguments and displays all the lines between the given line numbers

Answer»

"Here is the ANSWER: The shell script that accepts a file name, STARTING and ending line numbers as arguments and displays all the LINES between the given line numbers:


The shell script is:


$ awk ‘NR<2 || NR> 4 {print $0}’ 5 lines.dat


Input: line 1

line 2

line 3

line 4

line 5


Output: line 1

line 2

line 3

line 4

line 5"



Discussion

No Comment Found