Error related to plist complex key name 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:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;19781A58-AAF7-4D5A-AZB2-8D82F2A3ZA97@example.com&lt;/key&gt;
    &lt;dict&gt;
        &lt;key&gt;due&lt;/key&gt;
        &lt;date&gt;2018-02-27T05:00:00Z&lt;/date&gt;
        &lt;key&gt;start&lt;/key&gt;
        &lt;date&gt;2018-02-26T15:08:52Z&lt;/date&gt;
    &lt;/dict&gt;
&lt;/dict&gt;
&lt;/plist&gt;


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.
The solution does involve escaping characters, but it turns out that the plist utility does not respond well to “over-escaping”. If I escape only the periods in the key name and nothing else, it works fine. Specifically, the following command resulted in a successful key deletion:

plutil -remove "19781A58-AAF7-4D5A-AZB2-8D82F2A3ZA97@example\.com" example.plist