copy files from their link

Hi,
I’d like to write a shell script to copy a collection of the last
available shared libs but I don’t want to modify this script anytime.
I 'd like to make copy of my_lib.so.1.0 based on my_lib.so.

I didn’t see any command to get that info except ‘ls -l’ which would
need to use the powerfull/incomprehensible sed command.
I could write an exe and use readlink() but I’m very surprised that no
cmd or option exists to get it in a readable way.

Any idea?

Thanks,
Alain.

Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:
AB > Hi,
AB > I’d like to write a shell script to copy a collection of the last
AB > available shared libs but I don’t want to modify this script anytime.
AB > I 'd like to make copy of my_lib.so.1.0 based on my_lib.so.

AB > I didn’t see any command to get that info except ‘ls -l’ which would
AB > need to use the powerfull/incomprehensible sed command.
AB > I could write an exe and use readlink() but I’m very surprised that no
AB > cmd or option exists to get it in a readable way.

AB > Any idea?

AB > Thanks,
AB > Alain.

I’m not exactly sure what you want, but would some mix of:
ls | sort | uniq
give you what you want?


Bill Caroselli – Q-TPS Consulting
1-(708) 308-4956 <== Note: New Number
qtps@earthlink.net

Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:

I’d like to write a shell script to copy a collection of the last
available shared libs but I don’t want to modify this script anytime.
I 'd like to make copy of my_lib.so.1.0 based on my_lib.so.

I didn’t see any command to get that info except ‘ls -l’ which would
need to use the powerfull/incomprehensible sed command.
I could write an exe and use readlink() but I’m very surprised that no
cmd or option exists to get it in a readable way.

find my_lib.so -printf “%l\n”

Not to say that find isn’t also powerful/incomprehensible :slight_smile:.


Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

perfect,
Thanks Brian.

bstecher@qnx.com a écrit:

Alain Bonnefoy <> alain.bonnefoy@icbt.com> > wrote:


I’d like to write a shell script to copy a collection of the last
available shared libs but I don’t want to modify this script anytime.
I 'd like to make copy of my_lib.so.1.0 based on my_lib.so.





I didn’t see any command to get that info except ‘ls -l’ which would
need to use the powerfull/incomprehensible sed command.
I could write an exe and use readlink() but I’m very surprised that no
cmd or option exists to get it in a readable way.



find my_lib.so -printf “%l\n”

Not to say that find isn’t also powerful/incomprehensible > :slight_smile:> .