ZedZip
ZedZip

Reputation: 6478

Mac OS X: How to get result of otool inside a script?

I'd like to change dylib search path in a script. In the Terminal I use otool -L my.dylib, then see what is the search path and to change it use install_name_tool. The install_name_tool (-change) uses previous path and the new path as a arguments. How I can get result of otool -L to a script variable?

Upvotes: 0

Views: 438

Answers (1)

TheDarkKnight
TheDarkKnight

Reputation: 27631

How I can get result of otool -L to a script variable?

Run otool from the script:

OUTPUT=$(otool -L /Applications/Calculator.app/Contents/MacOS/Calculator)
echo $OUTPUT

Upvotes: 1

Related Questions