Reputation: 331
There is a shared library say, libsample.so & libsample.so.abc.xy (a,b,c,x and y are 0-9), former having soft link to latter.
How to extract "abc.xy" field from SONAME section of libsample.so?
I have tried below command : $ objdump -p libsample.so | grep SONAME | awk {' print $2'} this prints : libsample.so.abc.xy
But how to further fetch "abc.xy"?
Upvotes: 0
Views: 410
Reputation: 195229
sed 's/.*\.so.//'
Test:
kent$ sed 's/.*\.so.//' <<<"foo.so.bar.so.so.we.want.this"
we.want.this
awk -F'so[.]' '{print $NF}'
Test:
kent$ awk -F'so[.]' '{print $NF}' <<<"foo.so.bar.so.so.we.want.this"
we.want.this
Upvotes: 1