[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



> 
> 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.