Created
January 17, 2023 15:21
-
-
Save timvw/73bd8841ed81c6f17f61b7d1b9f0cd4a to your computer and use it in GitHub Desktop.
Copy and update all libs from /usr/local to current directory
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
for file in $(ls .); do | |
for ll in $(otool -L $file | grep -oE "/usr/local/[^ ]*"); do | |
echo "copying $ll to ." | |
sudo cp $ll . | |
#echo "" | |
done | |
done | |
for file in $(ls .); do | |
for ll in $(otool -L $file | grep -oE "/usr/local/[^ ]*"); do | |
echo "updating $file to point to $(pwd)/$(basename $ll)" | |
sudo install_name_tool -change $ll $(pwd)/$(basename $ll) $file | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment