According to the man page (let's have a look in the excerpt below) I
have to use the -f option.
If the link is an existing file, do not overwrite the
contents of the file. The -f option overrides this
option. This is the default behavior for /usr/xpg4/bin/ln,
and is silently ignored.
/usr/bin/ln
/usr/sbin/static/ln
/usr/xpg4/bin/ln
/usr/ucb/ln
No matter with which of the binaries above I am trying to overwrite an
existing symbolic link, I am getting an error. The environment is as
follows:
SunOS srvr2 5.9 Generic_122300-12 sun4u sparc SUNW,Sun-Fire-V440
rob@srvr2:~ $ touch source
rob@srvr2:~ $ touch 2ndsource
rob@srvr2:~ $ ln -s source foo
rob@srvr2:~ $ ln -s 2ndsource foo
ln: cannot create foo: File exists
rob@srvr2:~ $ ln -f -s 2ndsource foo
ln: cannot create foo: File exists
rob@srvr2:~ $ ln -n -f -s 2ndsource foo
ln: cannot create foo: File exists
rob@srvr2:~ $ ln -f -n -s 2ndsource foo
ln: cannot create foo: File exists
Thanks for any hints.
Regards,
Rob
Remove and recreate it.
> According to the man page (let's have a look in the excerpt below) I
> have to use the -f option.
Yes, I know. But I've never got it to work form me.
So, I remove and recreate and that works fine ;-)
--
Dick Hoogendijk -- PGP/GnuPG key: 01D2433D
++ http://nagual.nl/ | SunOS 10u4 08/07 ++
> quoting Robert Langdon (Fri, 29 Feb 2008 19:35:42 +0100):
>> How could I create, in exact terms overwrite, an existing symbolic
>> link with ln?
>
> Remove and recreate it.
>
>> According to the man page (let's have a look in the excerpt below) I
>> have to use the -f option.
>
> Yes, I know. But I've never got it to work form me.
> So, I remove and recreate and that works fine ;-)
Seems to be fixed in Nevada.
[duhring@einstein ~]$ uname -a
SunOS einstein 5.11 snv_82 i86pc i386 i86pc
[duhring@einstein ~]$ touch test
[duhring@einstein ~]$ touch test1
[duhring@einstein ~]$ ln -s test foo
[duhring@einstein ~]$ ln -s test1 foo
ln: cannot create foo: File exists
[duhring@einstein ~]$ ln -sf test1 foo
[duhring@einstein ~]$ ls -l foo
lrwxrwxrwx 1 duhring sysadmin 5 Feb 29 14:45 foo -> test1
[duhring@einstein ~]$ which ln
/usr/bin/ln
Hey nice to know that. Funny but because it never worked for me I never
took the change to try if things have changed. Sure they have, that
innovation, is it not. I'm running SXDE 1/08 on other machines (s10 is
just for the server). Just tried it on sxde4 and it works ;-)
But okay, the proof is the community. ;-)
Cheers,
Robert
I would call it evolution...