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
Answers
Answered by
0
"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"
Similar questions