gnu-misc-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: symlink weirdness


From: Tim Smith
Subject: Re: symlink weirdness
Date: Tue, 14 Sep 2004 15:21:39 GMT
User-agent: slrn/0.9.8.0 (Linux)

On 2004-09-14, Roger Dahl <rdnews@dahlsys.com> wrote:
> If your current directory is A and you want to create a relative symlink
> to a file in directory B in directory C, you need to type the path as it
> would look from C, not from A.
...
> This oddity complicates writing scripts that create symlinks.

This does not complicate writing scripts.  It makes writing scripts easier,
because it makes "ln -s" predictable.

> We need more intelligent 'ln' and 'cp -s', that, given paths from A to B
> and from A to C can create links between B and C.
>
> Any thoughts?

What a horrible idea.  "ln -s foo bar" is very simple now: it makes a
symlink at bar containing foo.  This is what you want in scripts. 

The correct way to do what you want is to write a *separate* program to
compute relative paths, e.g., 

    findrel B C

which would return a relative path to C starting from B, and then do this
in your script:

    ln -s `findrel B C` B/whatever

-- 
--Tim Smith

reply via email to

[Prev in Thread] Current Thread [Next in Thread]