[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: symlink weirdness
Re: symlink weirdness
14 Sep 2004 03:25:24 GMT
On 13 Sep 2004 17:11:56 -0700, Roger Dahl <firstname.lastname@example.org> 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.
> Though I understand that this makes 'ln' very simple (it just copies
> the argument into the link file), it doesn't make sense from a users
> perspective. When I'm in A, I can 'cp' from B to C without figuring
> out what the path to C will look like from B. 'cp -s' is even worse --
> it can only make links in the current directory.
> This oddity complicates writing scripts that create symlinks. 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?
If that was the case then how would I get the current behaviour for the
times that I want it.
I can get the behaviour you want with the current ln by doing
ln -s `pwd`/$B $C
(though it'd be better to to remove the /../ that might appear).
if ln did what you are suggesting then how would I get the current
ln -s ../init.d/ssh /etc/rc0.d/K20ssh
(Note: I want the symlink to have '..' in it and my current directory is
Wouldn't a simple tool that takes two arguments a directory A and a path B
and outputs path C that is the same location as B from A.
After all why should ln be special and have such logic when other tools
might also benefit. You'd use:
ln -s `relpath $C $B` $C
Re: symlink weirdness, Barry Margolin, 2004/09/13
Re: symlink weirdness, Tim Smith, 2004/09/14
- symlink weirdness, Roger Dahl, 2004/09/13
- Re: symlink weirdness, Barry Margolin, 2004/09/13
- Re: symlink weirdness,
Sam Holden <=
- Re: symlink weirdness, Roger Dahl, 2004/09/14
- Re: symlink weirdness, Stefan Monnier, 2004/09/14
- Re: symlink weirdness, Roger Dahl, 2004/09/15
- Re: symlink weirdness, Stefan Monnier, 2004/09/15
- Re: symlink weirdness, Roger Dahl, 2004/09/16
- Re: symlink weirdness, Barry Margolin, 2004/09/18