Operating System - HP-UX
1752790 Members
6085 Online
108789 Solutions
New Discussion юеВ

Re: linking 2 symbolick links to one

 
khilari
Regular Advisor

linking 2 symbolick links to one

well, i wanted to know that can 2 files be linked to one file. Kindly have a look at the below scenerio:

Care Manager 4>ln -s /opt/perl/bin/perl /usr/local/bin/perl
ln: perl exists
Care Manager 5>ls -l /opt/perl/bin/perl
lrwxr-xr-x 1 root sys 13 Dec 22 10:17 /opt/perl/bin/perl ->
./perl-static
Care Manager 10>ls -l /usr/local/bin/perl
-rwxr-xr-x 1 root sys 856089 Jul 21 1998 /usr/local/bin/perl
Care Manager 14>ls -l /opt/perl_32/bin/perl5.8.8
lrwxr-xr-x 1 root sys 13 Dec 22 10:17 perl5.8.8 -> ./perl-st
atic


have to link /opt/perl/bin/perl to /usr/local/bin/perl and /opt/perl/bin/perl is already linked to
/opt/perl/bin/perl ->
./perl-static
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor

Re: linking 2 symbolick links to one

Hi:

Yes, more than one link can exist to a file.

However, your problem is that the Perl in '/usr/local/bin/perl' is an old version. Perl 5.8.8 was was not available in 1998!

Do:

# /usr/local/bin/perl -v

...to see the version of that file. If you remove it (assuming that you don't need it) then you should be able to perform the link you want.

Regards!

...JRF...
Pete Randall
Outstanding Contributor

Re: linking 2 symbolick links to one

It's simply telling you that /usr/local/bin/perl already exists. Remove it, then link:

rm /usr/local/bin/perl
ln -s /opt/perl/bin/perl /usr/local/bin/perl


Pete

Pete
Raj D.
Honored Contributor

Re: linking 2 symbolick links to one

Khilari ,

You can try this,


As per the scenario you have already one link to perl-static

"
/opt/perl/bin/perl
lrwxr-xr-x 1 root sys 13 Dec 22 10:17 /opt/perl/bin/perl ->
./perl-static
"

remove the perl-static link and create it (/opt/perl/bin/perl) ) to /usr/local/bin/perl , hope it will work.


(Btw, what is the main objective. )

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Raj D.
Honored Contributor

Re: linking 2 symbolick links to one

Also if you have multiple perl5.8.8 files with named perl or may be of different versions you can check the version of the file with # what /usr/local/bin/perl

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
khilari
Regular Advisor

Re: linking 2 symbolick links to one

Ya, its an old version i just found out, but when i tried removing it it says there is a write process going on, i came to know this after using fuser
Care Manager 11>ps -ef | grep 8443
ccuser 8443 8414 0 Dec 25 ? 2:07 rptArchive ./rptArchive 8414 liv
e NA
ccuser 2998 8443 1 11:16:47 ? 0:00 sqlplus -s ccuser/bueno1
root 2993 2665 1 11:16:47 pts/t0 0:00 grep 8443

Should i kill the 8443 and then try it again.
Thanks
Raj D.
Honored Contributor

Re: linking 2 symbolick links to one

Khilari,

You need to check the process and if not needed you can kill. And What is rptArchive process that is running now. Also Check its parent process and hope fully you can find it out.

you can check the parent process with,
# ps -ef | grep 8414


cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
George Liu_4
Trusted Contributor

Re: linking 2 symbolick links to one

You can link one source to many targets, but you can't link more than one source to one target.