Shell Script to insert text after Tag

Hello,

I'm doing an Shell Script to insert a text on XML file, i tried sed, awk, perl... i'm doing something wrong, please help me :slight_smile:

well, the script is a bit large, i get some infos on script before 'run' this part to insert the text on XML...

domobile() {
    let i++
    echo
    echo "${i}. Auto mobile stream install"
	sed 's/.*<StartupStreams>.*/&\n<StartupStream>
	<Application>$login/_definst_</Application>
	<MediaCasterType>shoutcast</MediaCasterType>
	<StreamName>$login.stream</StreamName></StartupStream>/' ${INSTALLDIR}/conf/StartupStreams.xml

}

basically, after the tag <StartupStream> i need to add these infos;

<StartupStream>
	<Application>$login/_definst_</Application>
	<MediaCasterType>shoutcast</MediaCasterType>
	<StreamName>$login.stream</StreamName>
        </StartupStream>

can you guys help me?

Please edit your post and retag all CODE's to ONE CODE segment...
Dont mark every each single line, mark ALL LINES (in a row) as CODE.

Describe in between...

Then mark again as CODE..

EDIT1: sed line seems incomplete...
I know sed lines like:

sed s,"search","replace",g FILE
sed s/"search"/"replace"/g FILE
sed s\\"search"\\"replace"\\g FILE

Which one works best depends on the strings to replace...
hth