Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Using defaults read to get value from plist Post 302250297 by davewg on Thursday 23rd of October 2008 05:35:57 AM
Old 10-23-2008
Question Using defaults read to get value from plist

Hi there,

I'm trying to retrieve a value from a plist file, which I have done before with no problems, however this plist file looks a little different....

Normally it's like this;
<plist version="1.0">
<dict>
key>KeyName</key>
<string>blah</string>

I want the value of KeyName, so 'defaults read com.example KeyName' returns the value "blah".

But the plist I'm having problems with is like this....
<plist version="1.0">
<dict>
key>HEADING</key>
<dict>
<key>KeyName</key>
<string>blah</string>

...and 'defaults read com.example KeyName' returns an error saying the domain/default pair does not exist.

Please can anyone advise if there is a way to retrieve this value?

Kind Regards
davewg
 

10 More Discussions You Might Find Interesting

1. IP Networking

defaults httpd.conf

I have found in the httpd.conf where it it states the default parse pages like index.htm, index.html, index.php and etc....However, my computer box does not seem to want to automatically load the index.php files. Anyone have any ideas? (5 Replies)
Discussion started by: macdonto
5 Replies

2. Shell Programming and Scripting

Using 'defaults read' and storing the output in a variable

Hi all, I'm creating a script which uses 'defaults read' to retrieve details from an Info.plist like this; defaults read "/Path/Contents/Info" CFBundleShortVersionString This works fine in Terminal and returns the expected values. Is it possible to use this command in a script, and... (0 Replies)
Discussion started by: davewg
0 Replies

3. OS X (Apple)

the best way of editing .plist files

:( what is the best way of editing the various .plist files without adding third party files? Or is the easiest way is to add third party applications, which ones? please kept in mind that i am not a programmer. mike (1 Reply)
Discussion started by: mehow
1 Replies

4. UNIX for Dummies Questions & Answers

max os x .plist not running as scheduled?

Hello all, I am admittedly a newbie and have created a plist designed to fire off a shell script everyday at 3:00pm. It is located in /Library/LaunchDaemons/. I use it to mirror a hard local drive with a remote one. It worked one time but not again after that. I never restart the machine... (0 Replies)
Discussion started by: Movomito
0 Replies

5. UNIX for Advanced & Expert Users

assigning variables to their defaults

Hi, Is there any way to assign defaults values to the shell variables without reassigning them ( restarting the session) for example after login the value of ORACLE_HOME=/a/b/c i have changed this value from the console export ORACLE_HOME=/c/d now what if i want the value exported to... (1 Reply)
Discussion started by: clx
1 Replies

6. OS X (Apple)

Plist to Unix Executable

I'm using an old conversion method for converting a plist into an XML file, but that's not what I'm needing just via terminal now. What I'm looking for is an answer to convert a plist file into an executable. I'd like to import it into Casper and have the JSS push it out onto an image. In this... (6 Replies)
Discussion started by: unimachead
6 Replies

7. Shell Programming and Scripting

Parsing plist file ?

Hi, I wondered if it was possible to parse a plist file like this http://dl.dropbox.com/u/14586156/stuff/Bookmarks.plist so it will afterwards look like this <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"... (0 Replies)
Discussion started by: pasc
0 Replies

8. Shell Programming and Scripting

Parse hdiutil -plist data for specific info

I am trying to get the mounted size of a compressed .dmg. I can use hdiutil imageinfo -plist $imagename to get a lot of info, including what I need. The problem is that I have no idea how to parse that single piece of info into a variable (or in this case, array element). Here is what I have so... (2 Replies)
Discussion started by: nextyoyoma
2 Replies

9. Shell Programming and Scripting

Defaults read/write question

OSX 10.9 How does "defaults" know where to look for .plists? To expand: defaults read com.apple.finder is located in ~/Library/Preferences but, defaults read com.apple.mail is located in ~/Library/Containers/com.apple.mail/Data/Library/Preferences/com.apple.mail.plist So my question... (0 Replies)
Discussion started by: sudo
0 Replies

10. Shell Programming and Scripting

Editing .plists with defaults

I've done simple edits with defaults, but they usually are the parent parameter. For example changing the value of "DateCellWidthCache" =. What if I want to change a parameter in one of the sub categories such as "MMM d, y' '",? How do I type that out at the end of my defaults write command?: ... (1 Reply)
Discussion started by: sudo
1 Replies
HDAUDIOCTL(8)						    BSD System Manager's Manual 					     HDAUDIOCTL(8)

NAME
hdaudioctl -- program to manipulate hdaudio(4) devices. SYNOPSIS
hdaudioctl [-f device] command [arguments] DESCRIPTION
The hdaudioctl command can be used to inspect and reconfigure High Definition Audio devices and their child codecs. The mandatory command argument specifies the action to take. Valid commands are: list For each child codec of the chosen hdaudio(4) device, display the nid, vendor, product, subsystem and device IDs. get codecid nid Retrieve and display the current codec configuration as a proplib(3) XML plist. set codecid nid [plist] Detach the specified hdafg(4) codec and then re-attach with its widgets explicitly configured according to the specified plist. If no plist is given, the in-built widget parsing rules based on the High Definition Audio specification will be used. graph codecid nid Output a DOT file suitable processing by graphviz. The resulting image will graphically show the structure and intercon- nections of the widgets that form the chosen hdafg(4) codec. FILES
/dev/hdaudioX control devices SEE ALSO
audio(4), hdaudio(4), pkgsrc/graphics/graphviz HISTORY
The hdaudioctl command first appeared in NetBSD 5.1. AUTHORS
hdaudioctl is based on two separate programs written by Jared McNeill <jmcneill@NetBSD.org> under contract by Precedence Technologies Ltd <http://www.precedence.co.uk/>. Integration into one program and writing this manual page was done by Stephen Borrill <sborrill@NetBSD.org>. CAVEATS
When a plist is loaded and the hdafg(4) codec reattaches, all mixer controls will be returned to their default values. BSD
October 6, 2009 BSD
All times are GMT -4. The time now is 10:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy