Re: Going nuts/crazy with ln creating a symbolic link

From: Dave Carrigan (dave_at_rudedog.org)
Date: 05/26/04


Date: Wed, 26 May 2004 09:37:28 -0700

Fritz Bayer wrote:

> root@debian:/# ln -s /linktesting /tmp/burning/`date +%Y-%m-%d`

You now have a link

  /tmp/burning/2004-05-26 -> /linktesting

> root@debian:/# ln -s /linktesting /tmp/burning/`date +%Y-%m-%d`

Now, /tmp/burning/2004-05-26 exists, and is (points to) a directory, so ln
assumes you want to create a symlink inside that directory. In other words,
it behaves as if you had done

 ln -s /linktesting /tmp/burning/`date +%Y-%m-%d`/linktesting

So, now you have a link

  /tmp/burning/2004-05-26/linktesting -> /linktesting

> root@debian:/# ln -s /linktesting /tmp/burning/`date +%Y-%m-%d`

The behavior of this command is exactly the same as the previous command,
except this time the link already exists, so you get an error message.

-- 
Dave Carrigan
Seattle, WA, USA
dave@rudedog.org | http://www.rudedog.org/ | ICQ:161669680
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-C++-DNS-PalmOS-PostgreSQL-MySQL
Dave is currently listening to Jane Siberry - Follow Me (No Borders Here)