nicklec Posted March 25, 2011 Posted March 25, 2011 Trying to automatically create a .plist to setup a system profile for 802.1x or at the very least grab these strings from a .plist - the command is working from command line but i'd like to store it in a variable to create my plist later... Whats wrong with: machineid='/usr/libexec/plistbuddy -c print :AD\ Computer\ Kerberos\ ID /Library/Preferences/DirectoryService/ActiveDirectory.plist' This just gives me the command as text so i'm assuming the syntax is wrong to call plistbuddy? Can I set this variable via plistbuddy somehow?
Steve21 Posted March 25, 2011 Posted March 25, 2011 Try putting it into "'s Otherwise you're asking it to print the entire line aren't you? -c "print 'AD\ Computer\ Kerberos\ ID'" /Library/Preferences/DirectoryService/ActiveDirectory.plist' Try: usr/libexec/Plistbuddy \ -c "Print 'AD Computer Password'" \ /Library/Preferences/DirectoryService/ActiveDirectory.plist Too if above doesn't work Steve
nicklec Posted March 25, 2011 Author Posted March 25, 2011 Arrr just realised I was using apostrophes and not 'back quotes', my troubleshooting script: #!/bin/bash machineid=`/usr/libexec/plistbuddy -c 'print :AD\ Computer\ Kerberos\ ID' '/Library/Preferences/DirectoryService/ActiveDirectory.plist'` echo "$machineid"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now