The Computer Oracle

Reading values from plist nested dictionaries in shell script

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Island

--

Chapters
00:00 Reading Values From Plist Nested Dictionaries In Shell Script
01:03 Accepted Answer Score 18
01:14 Thank you

--

Full question
https://superuser.com/questions/486630/r...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#macos #shellscript #dictionary #plist

#avk47



ACCEPTED ANSWER

Score 18


defaults can't do this without a lot of mess, but PlistBuddy will:

/usr/libexec/PlistBuddy -c "print :Countries:USA:Capital" /Users/sameerp/Downloads/data.plist