[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Slightly OT: Extracting a line from a file.
- Subject: [ale] Slightly OT: Extracting a line from a file.
- From: byron at cc.gatech.edu (Byron A Jeff)
- Date: Fri, 6 Jul 2001 10:34:05 -0400 (EDT)
>
> 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.