01-21-2008
Use the 'defaults' command which is included with the OS, or the GUI Property List Editor which comes with the Developers toolkit. If you are on Leopard there is also a tool called PlistBuddy.
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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... (1 Reply)
Discussion started by: davewg
1 Replies
2. UNIX for Dummies Questions & Answers
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
3. Shell Programming and Scripting
Is there any command which I can apply from the command line to find and replace a particular text say "00:00:00:00" with "00" from all the files( where ever this text exists) of the current directory? (17 Replies)
Discussion started by: cobroraj
17 Replies
4. Shell Programming and Scripting
Hi All,
I have a folder that contains 100's of files and each file have a similar content like the following format:
((STBJa:200.0,((STBTz:200.0,(STSwe:200.0,(STDUw:200.0,(ST4Bu:200.0,STL2b:200.0):127.0):86.0):80.0):120.0,
STAHr:200.0):134.0):200.0,STuNg:200.0);What I need is to do is add "#1"... (2 Replies)
Discussion started by: Lucky Ali
2 Replies
5. OS X (Apple)
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
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
hello,
i have a problem.
suppose
file.txt
i want to add lines over those lines in a file if it starts and ends with how and "?" respectively.
i want output like
output
file.txt
thanks (4 Replies)
Discussion started by: yashwantkumar
4 Replies
8. Shell Programming and Scripting
#!/bin/bash
#
name=$1
type=$2
number=1
for file in ./**
do
if
then
filenumber=00$number
elif
then
filenumber=0$number
fi
tempname="$name""$filenumber"."$type"
if (4 Replies)
Discussion started by: TheGreatGizmo
4 Replies
9. UNIX for Dummies Questions & Answers
This is a smallpart of my input file.I want to change the ID values of entries having CMW as an entry.
Cont_1.266 . CMW 2958 3269 . - 0 PARENT=t:UM06506T0;ID=UM06506P0;rank=6
Cont_1.266 . CMW 3394 3505 . - 0 ... (3 Replies)
Discussion started by: sasdf
3 Replies
LEARN ABOUT OSX
plistbuddy
PLISTBUDDY(8) BSD System Manager's Manual PLISTBUDDY(8)
NAME
PlistBuddy -- read and write values to plists
SYNOPSIS
PlistBuddy [-cxh] file.plist
DESCRIPTION
The PlistBuddy command is used to read and modify values inside of a plist. Unless specified by the -c switch, PlistBuddy runs in interactive
mode.
The following commands are used to manipulate plist data:
Help Prints this information.
Exit Exits the program. Changes are not saved to the file.
Save Saves the current changes to the file.
Revert Reloads the last saved version of the file.
Clear type Clears out all existing entries, and creates root of type type. See below for a list of types.
Print [entry]
Prints value of entry. If an entry is not specified, prints entire file. See below for an explanation of how entry works.
Set entry value
Sets the value at entry to value.
Add entry type [value]
Adds entry with type type and optional value value. See below for a list of types.
Copy entrySrc entryDst
Copies the entrySrc property to entryDst.
Delete entry
Deletes entry from the plist.
Merge file [entry]
Adds the contents of plist file to entry.
Import entry file
Creates or sets entry to the contents of file.
Entries consist of property key names delimited by colons. Array items are specified by a zero-based integer index. Examples:
:CFBundleShortVersionString
:CFBundleDocumentTypes:2:CFBundleTypeExtensions
Entries may be of the following types:
string
array
dict
bool
real
integer
date
data
OPTIONS
-c command Execute command and exit. By default, PlistBuddy will run in interactive mode.
-x Output will be in the form of an xml plist where appropriate.
-h Print the complete help info.
EXAMPLES
Set the CFBundleIdentifier property to com.apple.plistbuddy:
Set :CFBundleIdentifier com.apple.plistbuddy
Add the CFBundleGetInfoString property to the plist:
Add :CFBundleGetInfoString string "App version 1.0.1"
Add a new item of type dict to the CFBundleDocumentTypes array:
Add :CFBundleDocumentTypes: dict
Add the new item to the beginning of the array:
Add :CFBundleDocumentTypes:0 dict
Delete the FIRST item in the array:
Delete :CFBundleDocumentTypes:0 dict
Delete the ENTIRE CFBundleDocumentTypes array:
Delete :CFBundleDocumentTypes
EXIT STATUS
PlistBuddy command returns a zero exit status if it succeeds. Non zero is returned in case of failure.
Mac OS X February 19, 2007 Mac OS X