re: piped "sed" not working
re: piped "sed" not working
- Subject: re: piped "sed" not working
- From: Chris Janton <email@hidden>
- Date: Sat, 17 Jan 2004 05:18:07 -0700
do shell script "sed -e
's/.*<key>Name<\\/key><string>\\(.*\\)<\\/string>/<td class=Name>\\/'
| sed
's/.*<key>Artist<\\/key><string>\\(.*\\)<\\/string>/<td
class=Artist>\\/' "
& inPOSIX & ">" & outPOSIX
for one, shouldn't there be a "-e" for the second sed command?
for two - why not use a different character for your substitute command
like
s|foo|bar|
instead of
s/foo/bar/
that way you don't get quite so many confusing escaped escape slashes
Oh, yeah, couldn't you use this construct
sed -e 's|a|b|' -e 's|X|Y|' file
this is what I get on the command line...
teatime 10 % sed -e 's|.*<key>Name</key><string>\(.*\)</string>|<td
class=Name>\1|' -e 's|.*<key>Artist</key><string>\(.*\)</string>|<td
class=Artist>\1|' plist
<key>Track ID</key><integer>456</integer>
<td class=Name>Rock Me Right
<td class=Artist>Susan Tedeschi
<key>Album</key><string>Just Won't Burn</string>
<key>Genre</key><string>Rock Blues</string>
<key>Kind</key><string>AAC audio file</string>
8)
----------------------------------
Chris Janton - face at CentosPrime dot COM
Netminder for Opus1.COM
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.