From owner-freebsd-questions Wed May 16 18:31:13 2001 Delivered-To: freebsd-questions@freebsd.org Received: from ren.sasknow.com (ren.sasknow.com [207.195.92.131]) by hub.freebsd.org (Postfix) with ESMTP id 751B037B422 for ; Wed, 16 May 2001 18:31:10 -0700 (PDT) (envelope-from ryan@sasknow.com) Received: from localhost (ryan@localhost) by ren.sasknow.com (8.9.3/8.9.3) with ESMTP id TAA29255 for ; Wed, 16 May 2001 19:31:09 -0600 (CST) (envelope-from ryan@sasknow.com) Date: Wed, 16 May 2001 19:31:09 -0600 (CST) From: Ryan Thompson To: freebsd-questions@freebsd.org Subject: Better way to get link count from shell? Message-ID: Organization: SaskNow Technologies [www.sasknow.com] MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hey everybody... Maybe it's the summer heat. Is there any preferred method to getting the link count of a file from the shell (any shell), i.e., in a shell script? I'm using /bin/ls -lda $filename | awk '{print $2}' but that, while convenient, is perhaps a bit clunky. Maybe it's the way to go, though. I don't really see any portability issues. I suppose the alternative would be to code a quick C program, but that seems equally clunky (if a bit faster in a loop). Am I missing anything obvious here? Thanks, - Ryan -- Ryan Thompson Network Administrator, Accounts SaskNow Technologies - http://www.sasknow.com #106-380 3120 8th St E - Saskatoon, SK - S7H 0W2 Tel: 306-664-3600 Fax: 306-664-1161 Saskatoon Toll-Free: 877-727-5669 (877-SASKNOW) North America To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message