From owner-freebsd-current@FreeBSD.ORG Wed Jan 12 01:11:09 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 681B116A4CE for ; Wed, 12 Jan 2005 01:11:09 +0000 (GMT) Received: from bloodwood.hunterlink.net.au (smtp-local.hunterlink.net.au [203.12.144.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id B700C43D41 for ; Wed, 12 Jan 2005 01:11:08 +0000 (GMT) (envelope-from boris@brooknet.com.au) Received: from [61.8.40.78] (ppp284E.dyn.pacific.net.au [61.8.40.78]) j0C1AJh1023500; Wed, 12 Jan 2005 12:10:37 +1100 Message-ID: <41E478FB.1060608@brooknet.com.au> Date: Wed, 12 Jan 2005 12:10:19 +1100 From: Sam Lawrance User-Agent: Mozilla Thunderbird 1.0 (X11/20050106) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sean McNeil References: <41E47226.8050001@elischer.org> <1105491274.67086.2.camel@server.mcneil.com> In-Reply-To: <1105491274.67086.2.camel@server.mcneil.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: FreeBSD Current cc: Julian Elischer Subject: Re: test(1) unexpected result (to me) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2005 01:11:09 -0000 Sean McNeil wrote: >On Tue, 2005-01-11 at 16:41 -0800, Julian Elischer wrote: > > >># ls -l /sys >>lrwxrwxrwx 1 root wheel 11 Sep 4 22:03 /sys -> usr/src/sys >># if [ /sys -ef /usr/src/sys ] >> > then >> > echo same >> > else >> > echo no >> > fi >>no >> >> >>I would have expected the result "same" >> >>comments? >> >> > >By "same file" they mean each references the same inode. Since this is >a symlink, the files do not refer to the same file. > >You can see that if it were a hard link the result would be "same" >echoed. > test -ef uses stat() to compare the inodes. stat returns the inode of the pointed-to file, not the link.