can i do this with sed?

floris

Registered
I want to do the folowing:
I want to add/remove a dock item, this has to be done in a script.

com.apple.dock.plist is the file with the dockitems. I want to insert text from a seperate textfile containing a dockitem.

any suggestions?

thanks!

Pieter
 
wow, great question! I've used sed in a very limited (that is, my knowledge of it limited me...) fashion on a couple occasions. but I have no idea about this. i'd be interested to see anyone's replies as well.
 
Any reason why you want to use sed to do this? The best way to do this would most likely be using applescript via osascript.

Brian
 
btoneill said:
Any reason why you want to use sed to do this? The best way to do this would most likely be using applescript via osascript.

Brian

you're right, i'll try applescript instead for now,
still want to know if I can do it with sed (or another tool) though!

anyone?

pieter
 
There are probably 100 different tools you could use to do it :) If you wanted you could do it with sed, with awk, with perl, tcl, php, c, c++, pascal, basic, lisp, elisp, python, etc etc etc :)

Brian
 
Well, there is an XML extension for applescript that might be easier than manually sed'ing the file. (Doing brute-force 'sed' on XML's is usually a pain, I can assure you).

dani++
 
Back
Top