MACSCRPT Archives

May 2010

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
jeff donovan <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Mon, 10 May 2010 09:38:20 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (28 lines)
Greetings

i need to add the contents of a file to the end of each line of a string. It would be easy to do a simple sed 's/mytext/newtext/g'

newtext in this case is an xml file. which needs to stay intact.

my text looks like this

one:two:three:four:five:


output needs to look like this


one:two:three:four: <?xml version="1.0" encoding="UTF-8"?>\
<dict>\
	<key>AccountState</key>\
	<string>Enabled</string>\
</dict>\


So I thought i could ;
REPLACE=/path/to/myfile
cat mytext | sed 's/five/$REPLACE/g'


im getting stuck any assistance would be helpful.
-j

ATOM RSS1 RSS2