On 24Aug2015 13:55, Paolo Galtieri <pgaltieri@xxxxxxxxx> wrote:
I've tried this on 2 different systems, and on both systems ln -s
fails in the same way.
Here's the steps
mkdir Test
cd Test
afile
cd ..
ln -s Test/afile Test/afile2
ls -l Test
This is the output:
/bin/ls: cannot access Test/afile2: No such file or directory
total 0
-rw-rw-r--. 1 pgaltieri pgaltieri 0 Aug 24 13:46 afile
l?????????? ? ? ? ? ? afile2
[...]
Firstly, run "/bin/ls", not "ls". Many system ship with an alias called "ls"
with presupplied various options, which is misleading. IMO this is a terrible
idea - the alias should at least use another name. (I have ones called "l" and
"L" for these conveniences, myself.)
To your problem:
Symlinks are strings resolved with respect to the directory in which the
symlink exists.
So the example above "Test/afile" => "Test/afile2" makes a symlink _in_ the
directory "Test" named "afile2" pointing at "Test/afile". Therefore it tries to
access the path "Test/Test/afile", which fails as one might expect.
When making a symbolic link it needs to either be (a) an absolute path or (b)
relative WRT to the directory hodling the link. For the latter, the reliable
way is to cd to the directory and make in from inside. That way command line
filename completion prodcues working results.
Cheers,
Cameron Simpson <cs@xxxxxxxxxx>
Unix is user-friendly. It's just picky about who its friends are.
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org