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

> [EMAIL PROTECTED] 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
> [EMAIL PROTECTED] tmp]# ln -sf junk/ cvv
> [EMAIL PROTECTED] 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
> [EMAIL PROTECTED] tmp]# ln -sfv gconfd-root/ cvv
> create symbolic link `cvv/gconfd-root' to `gconfd-root/'
> [EMAIL PROTECTED] 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


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to