> I know how to use symbolic links, and the "-L" and "-P" options of the
> "cd" and "pwd" commands.
> If I do : "cd -L /usr/adm ; lc ..", I expect to see the same result than
> "lc /usr", but what I get is "lc /var".
> I've tried with "sh -L", and I get the same result.If seems that the
> "-L" option only affects
> the "cd" and "pwd" commands, but "lc" or any other command always
> follows the phisical path.
> Is there any way for forcing all commands to follow the logical path ?
The "logical path" exists only inside the shell's mind. When you run
`lc ..`, you are running an external program, and passing to it the name
of an actual file in the current directory. All directories have a file
(actually a directory) in them, named "..", which is their parent.
There is only one instance of a particular directory, and its ".." is
always the same, no matter how you cd'd to it.
You might propose that the shell should modify the `..' you've typed,
changing it to the "logical" parent of the current directory. You would
type `lc ..`, but the shell would actually run `lc /usr`. The problem
with that is, the shell has to assume that ".." always refers to a
filename. But you might be doing something completely different:
The shell would also have to do complex parsing of the command line.
lc /tmp ..
dd if=../foo of=../bar/baz
Even if it did all that, there's no way it could affect references to
".." from inside a program:
Enter the name of the file to print: ../myfile