Created
January 23, 2017 13:47
-
-
Save jonasbn/0a76381c54463e4fff110545fc5777e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# script to change the dynamic lib paths and ids for oracle instant client | |
# exes and libs | |
# REF: http://www.nntp.perl.org/group/perl.dbi.users/2013/04/msg36561.html | |
# proces all the executable files in this directory | |
for exe in sqlplus adrci genezi uidrvci | |
do | |
echo "adjusting executable $exe" | |
baseexe=`basename $exe` | |
otool -L $exe | awk '/oracle/ {print $1}' | while read lib | |
do | |
echo "adjusting lib $lib" | |
baselib=`basename $lib` | |
if [ "$baseexe" = "$baselib" ] | |
then | |
echo "changing id to $baselib for $exe" | |
install_name_tool -id $baselib $exe | |
else | |
echo "changing path id for $lib in $exe" | |
install_name_tool -change $lib @executable_path/$baselib $exe | |
fi | |
done | |
done | |
for exe in *dylib* | |
do | |
echo "adjusting executable $exe" | |
baseexe=`basename $exe` | |
otool -L $exe | awk '/oracle/ {print $1}' | while read lib | |
do | |
echo "adjusting lib $lib" | |
baselib=`basename $lib` | |
if [ "$baseexe" = "$baselib" ] | |
then | |
echo "changing id to $baselib for $exe" | |
install_name_tool -id $baselib $exe | |
else | |
echo "changing path id for $lib in $exe" | |
install_name_tool -change $lib @loader_path/$baselib $exe | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment