bug-coreutils
[Top][All Lists]
Advanced

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

Re: ln -sf bug


From: Bob Proulx
Subject: Re: ln -sf bug
Date: Fri, 19 Aug 2005 00:40:28 -0600
User-agent: Mutt/1.5.9i

Lambert Tran wrote:
> ln -sf does not remove the existing destination files. The old link is kept

You may find these previous discussions useful.

  http://lists.gnu.org/archive/html/bug-fileutils/2003-10/msg00001.html

And more recently.

  http://lists.gnu.org/archive/html/bug-coreutils/2005-05/msg00171.html

> address@hidden tmp]# ll
> total 300
> -rw-rw-rw-  1 sentry adge      0 Aug 17 20:35 dtool_user_file_list
> drwx------  3 root   root   4096 Jul 29 08:26 gconfd-root
> drwxr-xr-x  2 root   root   4096 Aug 10 13:32 junk
> address@hidden tmp]# ln -sf junk/ cvv
> address@hidden tmp]# ll
> total 300
> lrwxrwxrwx  1 root   root      5 Aug 18 05:30 cvv -> junk/
> drwx------  3 root   root   4096 Jul 29 08:26 gconfd-root
> address@hidden tmp]# ln -sfv gconfd-root/ cvv
> create symbolic link `cvv/gconfd-root' to `gconfd-root/'
> address@hidden tmp]# ll
> total 300
> lrwxrwxrwx  1 root   root      5 Aug 18 05:30 cvv -> junk/

This is BSD style functionality.  You are probably wanting SysV style
functionality.  The only portable way to do this is to remove the
symlink first.

  rm -f cvv
  ln -s junk cvv

Also best to remove the slash from the value of the link.

As an extension but something that won't work on legacy SysV like
systems such as HP-UX or AIX you can use the -n option.

  ln -fns junk cvv

Bob




reply via email to

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