I read about 2 methods to run commands like these:
Where multiple commands are combined using pipes. I read about the /bin/sh way where you set the launch path to /bin/sh, the first argument to @"-c", second argument to whatever your command is, and then the 3rd argument to nil (as usual with NSTask). This way did not work for me and did not return an output.
I also read that you can set each command and its arguments individually and then combine them together with multiple NSPipe objects. However, I am confused as to how I would go about doing this. Any help would be appreciated. Thanks
Code:
otool -L /Applications/TextEdit.app/Contents/MacOS/TextEdit | awk 'NR>1{print $1}' | sed -e '/@executable_path/d' -e 's/(.*)$//' -e 's/\/Versions.*$//'
Where multiple commands are combined using pipes. I read about the /bin/sh way where you set the launch path to /bin/sh, the first argument to @"-c", second argument to whatever your command is, and then the 3rd argument to nil (as usual with NSTask). This way did not work for me and did not return an output.
I also read that you can set each command and its arguments individually and then combine them together with multiple NSPipe objects. However, I am confused as to how I would go about doing this. Any help would be appreciated. Thanks