From owner-freebsd-questions Mon Oct 8 21:49:31 2001 Delivered-To: freebsd-questions@freebsd.org Received: from ns5.eds.com (ns5.eds.com [203.17.185.230]) by hub.freebsd.org (Postfix) with ESMTP id C5C8537B403 for ; Mon, 8 Oct 2001 21:49:26 -0700 (PDT) Received: from nnsy.eds.com (nnsy-3.eds.com [192.168.1.1]) by ns5.eds.com (8.11.1/8.11.1) with ESMTP id f994nD021406; Tue, 9 Oct 2001 14:49:13 +1000 (EST) Received: from nnsy.eds.com (localhost [127.0.0.1]) by nnsy.eds.com (8.11.3/8.11.3) with ESMTP id f994nBL00874; Tue, 9 Oct 2001 14:49:11 +1000 (EST) Received: from ausym000.exau01.exch.eds.com ([134.251.177.117]) by nnsy.eds.com (8.11.3/8.11.3) with ESMTP id f994nAJ00861; Tue, 9 Oct 2001 14:49:11 +1000 (EST) Received: by AUSYM000 with Internet Mail Service (5.5.2653.19) id ; Tue, 9 Oct 2001 14:49:02 +1000 Message-ID: <16649A8D5C73D51183B80008C728EEB7CC09E6@AUSYM103> From: "Pietralla, Siegfried P" To: "'BSD Freak'" , FreeBSD Questions Subject: RE: Outputing a specific line number to standard output Date: Tue, 9 Oct 2001 14:49:00 +1000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG hi there, two simple ways: using awk: $ awk 'NR==54{print;exit}' myfile.txt using head and tail: $ tail +54 myfile.txt | head -1 regards, siegfried. -----Original Message----- From: BSD Freak [mailto:bsd-freak@mbox.com.au] Sent: Tuesday, 9 October 2001 14:30 To: FreeBSD Questions Subject: Outputing a specific line number to standard output Hi all, I feel stupid asking this but I have looked in the man page for grep, sort , cat, head and cut and have not been able to find the answer. How do I output to standard output a particular line number in a text file? For example say I want to display line 54 in the file myfile.txt . How do I do this? Thanks in advance..... --------------------------------------------------------------------- mBox is unified messaging and now has the mBeeper! Be the first to trial it. http://www.mbox.com.au/mbeeper To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message