Thursday, May 31, 2012

Find all Plist Files in a Directory and Convert Contents into XML Files


Works on MacOSX Boxes:

#!/bin/bash
# Cheers!
find $1 -iname "*.plist" | while read f; do
  xml_file=`echo $f | sed "s/\.plist/\.xml/g"`
  echo "Found $f"

  echo -n "Converting to XML..."

  /usr/libexec/PlistBuddy -c 'Print' $f > $xml_file

  echo "complete."

  echo "XML file resides in: $xml_file"
done

2 comments:

  1. Hey your blog is freakin AWSOME, I found literally every single post interesting!!
    You are good, seriously good.. You already knew that though :)

    I appreciate you posting your hard work here and I really hope you will post more often.

    ReplyDelete
  2. Thank you my friend, I will do my best...pass on the knowledge!

    ReplyDelete