[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
symlinks to directories and ..
From: |
Peter Werner |
Subject: |
symlinks to directories and .. |
Date: |
Tue, 18 Jun 2002 09:25:20 +0100 |
Configuration Information:
Machine: sparc
OS: solaris2.7
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc'
-DCONF_OSTYPE='solaris2.7' -DCONF_MACHTYPE='sparc-sun-solaris2.7'
-DCONF_VENDOR='sun' -DSHELL -DHAVE_CONFIG_H -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I. -I. -I./include -I./lib
-I/usr/local/include -g -O2
uname output: SunOS wgsn1 5.7 Generic_106541-08 sun4u sparc SUNW,Ultra-250
Machine Type: sparc-sun-solaris2.7
Bash Version: 2.05
Patch Level: 0
Release Status: release
Description:
its my understanding that when a symlink to a directory is followed,
the
parent directory of the new CWD will be the real parent directory,
not the
directory containing the link.
it is also my understanding that many shells will hide this from the
user
making the parent directory appear to be the directory containing
the symlink.
bash seems to be doing this, and is causing confusion when '..' is
used.
after following a directory symlink, 'ls ..' will display the
contents of the
real parent dir, but 'cd ..' will place you in the directory
containg the symlink
substitute ls for any external program (cat grep etc)
Repeat-By:
[Describe the sequence of events that causes the problem
to occur.]
mkdir -p /some/directory/hier
ln -s /some/directory/hier dirlink
touch file1
touch /some/directory/file2
cd dirlink
ls ..
^ shows file2 and hier not file1 and dirlink
cd ..
ls
^ shows file1 and dirlink
- symlinks to directories and ..,
Peter Werner <=