Skip to content

Instantly share code, notes, and snippets.

@timvw
Created January 17, 2023 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timvw/73bd8841ed81c6f17f61b7d1b9f0cd4a to your computer and use it in GitHub Desktop.
Save timvw/73bd8841ed81c6f17f61b7d1b9f0cd4a to your computer and use it in GitHub Desktop.
Copy and update all libs from /usr/local to current directory
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