I am trying to copy the Root Dictionary from a plist file and adding it to another plist file
git clone https://github.com/rahulkatariya/osx-terminal.app-colors-solarized.git
mv osx-terminal.app-colors-solarized/Solarized\ Dark.terminal osx-terminal.app-colors-solarized/Solarized\ Dark.plist
solarizedDark=`/usr/libexec/PlistBuddy -c "Print" osx-terminal.app-colors-solarized/Solarized\ Dark.plist 2>&1`
/usr/libexec/PlistBuddy -c "Add :Window\ Settings:Solarized\ Dark dict $solarizedDark" ~/Library/Preferences/com.apple.Terminal.plist
The output still creates an empty dictionary of Solarized Dark inside Window Settings Dictionary but with 0 items
Solved
I added an empty Dict and then used the Merge command of PlistBuddy to add all entries of the file inside the new dict like below
/usr/libexec/PlistBuddy -c "Add ':Window Settings:Solarized Dark' dict" ~/Library/Preferences/com.apple.Terminal.plist
/usr/libexec/PlistBuddy -c "Merge 'osx-terminal.app-colors-solarized/Solarized Dark.plist' ':Window Settings:Solarized Dark'" ~/Library/Preferences/com.apple.Terminal.plist