Last active
January 23, 2017 13:46
-
-
Save jonasbn/c93f49c4cccb8088fd56205d29f5af1c to your computer and use it in GitHub Desktop.
script to change the dynamic library paths and ids for oracle instant client executables and libraries
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 library paths and ids for oracle instant client executables and libraries | |
# REF: http://blog.caseylucas.com/2013/03/03/oracle-sqlplus-and-instant-client-on-mac-osx-without-dyld_library_path/ | |
# proces all the executable files in this directory | |
find . -maxdepth 1 -type f \( -perm -1 -o \( -perm -10 -o -perm -100 \) \) -print | while read exe | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment