escaping characters

OK, I am stumped on this one.

I am trying to loop through a plist file to determine which (if any) items I need to delete. The problem is the escaping characters. The plist in question is (which is in ~/Library/Preferences/ByHost).

From a terminal I would use

/usr/libexec/PlistBuddy -c "Print :58\\:b0\\:35\\:7d\\:1f\\:f0:0"  ~/Library/Preferences/ByHost/

to return the particular item, in this case item 0.

My goal is to complete this via the do shell script command so that I can catch the results of the line above piped into a grep statement that way I can loop through it deleting all the Items that match the SSID. Would REALLY like to avoid just deleting the file.

Any thoughts on how to do this? Is there a better solution.

Any help is appreciated.


for posterity sake:

“Print :58\\:b0\\:35\\:7d\\:1f\\:f0”

it took 4 backslashes via Applescript to equal “Print :58\:b0\:35\:7d\:1f\:f0:0” via terminal.