I am tying building a php/bash/mysql system for automating adhoc distribution for iPhone apps. But I want to read the application-identifier key in mobileprovision file of p
One solution among many...
Use egrep with the -a option, which treats binary files like text files and '-A 2' which will display the two lines after the string you want to match: ApplicationIdentifierPrefix.
After that, trim the line of brackets and whitespace using sed.
Using a series of pipes:
egrep -a -A 2 ApplicationIdentifierPrefix file.mobileprovision | grep string | sed -e 's///' -e 's/<\/string>//' -e 's/ //'