I am trying to determine how to resolve an error related to a complex key name in a property list file. The plist file contents are as follows:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>19781A58-AAF7-4D5A-AZB2-8D82F2A3ZA97@example.com</key> <dict> <key>due</key> <date>2018-02-27T05:00:00Z</date> <key>start</key> <date>2018-02-26T15:08:52Z</date> </dict> </dict> </plist>
The file was created using
plutil and the key/value pair as shown above was accepted/created without an issue. However, if I attempt to remove the key/value (
plutil -remove "19781A58-AAF7-4D5A-AZB2-8D82F2A3ZA97@example.com" example.plist), I receive the following error:
example.plist: Could not modify plist, error: No value to remove at key path 19781A58-AAF7-4D5A-AZB2-8D82F2A3ZA97@example.com
The reason I believe this has to do with the complex key name is that I can manually change the key name to “Test”, at which point the removal command works as expected.
I tried both quote-enclosing the key name and not, as well as escaping the period and at sign (@), but the same error was observed across all approaches.