[plug] Scripting Help - Search, Mangle, Replace

Timothy White weirdit at gmail.com
Fri Jun 22 18:07:07 WST 2007


I have some interesting scripting I'm trying to do, and wish to avoid
Perl/PHP and the more complex languages.

Basically, I have a document that has a number of occurences of
<U>Some text</U> and I wish to search for all occurences, and remove
the <U> tags, and append to the end of it, the output of a "command"
or "script" that depends on the "Some text" as input.

So for example.

Random <U>Dogs</U> eat my followers
turns into

Random Dogs <sup>Pink</sup> eat my followers
With "<sup>Pink</sup>" being the output of `scatter 'Dog'`

Any clues? I was hoping awk would help, but other than pattern
matching, no such luck. Sed has also left me in the cold so far. Short
of a bash script that does the search, makes a replacement array, then
does the search and replace?

Thanks

Tim

-- 
Linux Counter user #273956
Don't email joeblogs at scouts.org.au



More information about the plug mailing list