datacamp-content / courses-introduction-to-shell

Introduction to Shell by Greg Wilson
Other
47 stars 47 forks source link

Possibly wrong solution | Chapter 5 Exercise 6 #99

Closed Hadrien-lcrx closed 6 years ago

Hadrien-lcrx commented 6 years ago

In How can I process a single argument, student sends this feedback: """ Instructions asks to select lines 5-8 from a file. The correct answer shown is: head -n $3 $1 | tail -n $2. However this will show lines 4-8 as the tail comment will pull that last 5 lines of the 8 from head, but what you want in this case is the inclusive difference which is 4 (8-5+1). sed -n 5,8p filename would work though ;) although I'm not sure if the course gets to using sed. """

Screenshot

image

Cf d3dclark@gmail.com #64974 Cc @bakera81

gvwilson commented 6 years ago

Should be closed by 97a7f4b.