GNU bug report logs - #7634
anomaly ln command

Previous Next

Package: coreutils;

Reported by: Baggia Nate <baggianate <at> gmail.com>

Date: Mon, 13 Dec 2010 14:00:04 UTC

Severity: normal

Tags: notabug

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7634 in the body.
You can then email your comments to 7634 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#7634; Package coreutils. (Mon, 13 Dec 2010 14:00:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Baggia Nate <baggianate <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 13 Dec 2010 14:00:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Baggia Nate <baggianate <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: anomaly ln command
Date: Mon, 13 Dec 2010 15:02:29 +0100
[Message part 1 (text/plain, inline)]
Hello,
work with Fedora (version 14) and I noticed that the command:

*ln -fs /path/from /path/to*

does not actually remove the target path.
In my case the */path/to* correspond to another symbolic link (*/path/other*
).
Why not work even if given the option *-f* (*--force*) flag?
Ascolta
Trascrizione fonetica
[Message part 2 (text/html, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#7634; Package coreutils. (Mon, 13 Dec 2010 15:20:02 GMT) Full text and rfc822 format available.

Message #8 received at 7634 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Baggia Nate <baggianate <at> gmail.com>
Cc: 7634 <at> debbugs.gnu.org
Subject: Re: bug#7634: anomaly ln command
Date: Mon, 13 Dec 2010 15:22:55 +0000
On 13/12/10 14:02, Baggia Nate wrote:
> Hello,
> work with Fedora (version 14) and I noticed that the command:
> 
> *ln -fs /path/from /path/to*
> 
> does not actually remove the target path.
> In my case the */path/to* correspond to another symbolic link (*/path/other*
> ).
> Why not work even if given the option *-f* (*--force*) flag?
> Ascolta
> Trascrizione fonetica
> 

Do you also need the -n option?
My default `ln` usage is -nfs

cheers,
Pádraig.




Added tag(s) notabug. Request was from Jim Meyering <jim <at> meyering.net> to control <at> debbugs.gnu.org. (Mon, 13 Dec 2010 16:05:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to Baggia Nate <baggianate <at> gmail.com> Request was from Jim Meyering <jim <at> meyering.net> to control <at> debbugs.gnu.org. (Mon, 13 Dec 2010 16:05:01 GMT) Full text and rfc822 format available.

Message #13 received at 7634-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Baggia Nate <baggianate <at> gmail.com>
Cc: 7634-done <at> debbugs.gnu.org
Subject: Re: bug#7634: anomaly ln command
Date: Mon, 13 Dec 2010 16:10:08 +0000
On 13/12/10 15:22, Pádraig Brady wrote:
> On 13/12/10 14:02, Baggia Nate wrote:
> Do you also need the -n option?
> My default `ln` usage is -nfs

OP confirms -n addresses his issue. closing...




Message #14 received at 7634-done <at> debbugs.gnu.org (full text, mbox):

From: Bob Proulx <bob <at> proulx.com>
To: Baggia Nate <baggianate <at> gmail.com>
Cc: 7634-done <at> debbugs.gnu.org
Subject: Re: bug#7634: anomaly ln command
Date: Mon, 13 Dec 2010 10:06:23 -0700
Baggia Nate wrote:
> work with Fedora (version 14) and I noticed that the command:
> 
> *ln -fs /path/from /path/to*
> 
> does not actually remove the target path.

That is intentional behavior.  This is because that is what BSD does
and BSD created the ln command.  The GNU ln follows the BSD ln
behavior.  This gets discussed every so often and the archives will
have a much longer discussion of it.

> In my case the */path/to* correspond to another symbolic link
> (*/path/other* ).  Why not work even if given the option *-f*
> (*--force*) flag?

If you are used to the System V behavior then this will be a
difference.  SysV ln always behaves as if the -n option has been
given.  The only portable way to deal with differences between SysV
and BSD behaviors is to remove the target symlink before creating the
new one.

  rm -f /path/to
  ln -sf /path/from /path/to

The BSD (and therefore GNU) expectation would be to use the -n
option.  But SysV does not support the -n option.  But if you are not
concerned about portability to SysV then that is the easiest way.

  ln -sfn /path/from /path/to

Since this is intentional behavior I am closing the bug.  But feel
free to continue the discussion if more information, clarification or
discussion is needed.

Bob




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 11 Jan 2011 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 161 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.