Re: test(1) unexpected result (to me)

From: Julian Elischer <julian_at_elischer.org>
Date: Tue, 11 Jan 2005 17:13:58 -0800
never mind.. pilot error..
# ls -lL /sys
lrwxrwxrwx  1 root  wheel  11 Sep  4 22:03 /sys -> usr/src/sys
# ls -l /usr/src/sys
ls: /usr/src/sys: No such file or directory
# mkdir /usr/src/sys
#

# if [ /sys -ef /usr/src/sys ]
 > then
 > echo same
 > else
 > echo no
 > fi
same


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.
>
>Cheers,
>Sean
>
>  
>
Received on Wed Jan 12 2005 - 00:13:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:26 UTC