0

I'm trying to use the following approach to subset the output of a manual:

man dig | nl | tail -n +389 | head -n 6

However, the output starts at line 304, not line 389. Doing some research, it seems lines marked as "#####################" are not counted. This is very aggravating, and one of my current books was using this approach to subset number lines.

Is there any solution to fix the overlooked lines?

4

By default, nl doesn’t number blank lines.

man dig | nl -ba | tail -n +389 | head -n 6

will show that tail is doing the right thing. -ba instructs nl to number all lines.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.