Hi,
I am brand new to unix and am hoping someone can start me in the right direction.
I want to be able to put the results of a file command such as wc -l filename into a variable which I can then use to test against another variable...i.e. I need to show the nth line of a file, but need to determine if the file contains at least n lines. currently the output from wc -l filename gives me a return of n filename - all I want is n as a numerical value.
Secondly, is there a way to retrieve the nth line of a file using a single command (similar to head or tail, but actually giving the line number?)
If anyone can help it would be appreciated.