Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read Info From Second Line 1

Status
Not open for further replies.

harwooddale

Programmer
Feb 7, 2003
40
GB
Hi,
I have a file which is the output from a directory.
i need to select the file name from the second line in the file.
I know how to get it if it is on the first ie first_file=`head -1 $listfile`
but not the second.

Help Gratefully Appreciated
 
sed -n '2p' filename
awk ' {if (NR == 2) {print}}' filename
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top