Kostadin Karaivanov wrote:
The system :
root@larry:/usr/src# cat linux/fs/xfs/linux/xfs_version.h | grep \#
#ifndef __XFS_VERSION_H__
#define __XFS_VERSION_H__
#define XFS_VERSION_STRING "CVS-10/09/02:05"
#endif /* __XFS_VERSION_H__ */
/ is on XFS partittion
The problem (?): I have /usr/src directory like that
root@larry:/usr/src# ls -al
total 5752
drwxr-xr-x 8 root root 4096 ??? 9 12:55 ./
drwxr-xr-x 18 root root 4096 ??? 30 05:54 ../
drwxr-xr-x 8 79 304 4096 ??? 9 12:18
freeswan-2.00pre2/
-rw-r--r-- 1 root root 1707055 ??? 19 23:05
freeswan-2.00pre2.k2.0.patch
-rw-r--r-- 1 root root 1707113 ??? 19 23:05
freeswan-2.00pre2.k2.2.patch
-rw-r--r-- 1 root root 1706937 ??? 19 23:05
freeswan-2.00pre2.k2.4.patch
lrwxr-xr-x 1 root root 19 ??? 9 12:22 linux ->
linux-2.4-xfs/linux/
drwxr-xr-x 17 root root 4096 ??? 24 12:50
linux09152002+crypt/
drwxr-xr-x 5 root root 38 ??? 5 14:07 linux-2.4-xfs/
-rw-r--r-- 1 root root 29859 ??? 30 16:49
loop-jari-2.4.18.0.patch
-rw-r--r-- 1 root root 678738 ??? 9 07:38
patch-int-2.4.19.1
drwxr-xr-x 2 root bin 20480 ??? 27 00:12 qmail-1.03/
drwxr-xr-x 7 root root 67 ??? 24 2002 rpm/
drwxr-xr-x 3 root root 83 ??? 22 19:33 test/
when I make
root@larry:/usr/src# cd linux
root@larry:/usr/src/linux# ls ../
cmd/ CVS/ linux/
I get the content of /usr/src/linux-2.4-xfs/ - although I have no memories
about the behavior of privios kernels, I expect to get content of /usr/src
itself
cause when I make cd ../ I go to /usr/src..... is this expected ???
This is expected - the CWD is what the command (ls) runs in and
the ".." points to the directory above.
Some shells have, either as an option or default behavior, the
feature that the "cd" command (which runs within the shell)
interprets the string based on what path the shell thinks you
went down.
For example, in my system I have:
farmer:/home/mks> ls -l linux
lrwxrwxr-x 1 22 Mar 5 2002 linux -> /usr/src/linux-2.4-xfs/
so if I cd to linux, I get:
farmer:/home/mks> cd linux
farmer:/home/mks/linux> pwd
/usr/src/linux-2.4-xfs
The shell itself does the CD command and if I "cd .." I get:
farmer:/home/mks/linux> cd ..
farmer:/home/mks>
However, that is only because the shell has its own concept of the
current directory (as seen in the prompt) vs the actual/physical
current directory (as seen by pwd)
Unless the shell replaces the string "../" with something else,
any external command (ls, cp, etc) will see that string within
the context of the actual directory.
This has, as far as I know, always been the case in Linux, Unix, etc.
(Albeit, not all shells support the special handling and will end
up just using the actual directory rather than the "logical" one.)
--
Michael Sinz -- Director, Systems Engineering -- Worldgate Communications
A master's secrets are only as good as
the master's ability to explain them to others.
|