[ale] Slightly OT: Extracting a line from a file.

Byron A Jeff byron at cc.gatech.edu
Fri Jul 6 10:34:05 EDT 2001


> 
> In bash, given a line number what is the simplest way to extract that line from a file?
> 

Presuming that the line number is in the environment variable LINE:

oneline=`head -$LINE filename | tail -1`

oneline will have the single line in filename.

BAJ
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list