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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying a specific line of text, knowing the line number

Status
Not open for further replies.

dinoviapangea

Technical User
Apr 9, 2002
41
US
I'm a novice Unix person so please bear with me. I have a text file and I know what line I want to display. Say I've created a variable $line that equal a certain line number. I want to display just the line $line. I've tried the following but kept getting a sed: command garbled:

set file_row = `sed -n '{$line}p;{$line}q' temp.txt |awk '{print $1}' `

It should be a simple command but I can find a simple answer any where. Any help would be appreciated.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top