Posted: Mon 01 Oct 2012, 23:34 Post subject:
Trying to make script to insert file into tmp.txt
G'day,
After trawling through the Internet I've come to a standstill with the following script. And I'm not a scripting guru....
I want to insert the file exit1.tx into the middle of tmp.txt.
I know that the expressions for lines and middle work however it doesn't want to play ball with sed. If I substitute ${middle} with a number then the sed expression works
exit1.txt has this:
Code:
<icon x="704" y="704" label="Exit User Desktop">/usr/share/Audio-lauchers/desktop/User/exit</icon>
so it's chock full of characters which interfere with sed's syntax.
Since placing some xml code in the middle of a file might break up an existing xml sequence, you may find it better to put it following a known line. For instance, if an existing tag in "tmp.txt" ends with </icon> , you could place "exit1.txt" in the line following that tag end by -
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum