Results 1 to 4 of 4
Here the question.
orion-web.xml is a file which has mode nodes of which
<webapp>
</webapp>
is one of the it.
How can we add
<session-config>
<session-timeout>-1s</session-timeout>
<session-config>
Here is the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-20-2011 #1Just Joined!
- Join Date
- Aug 2010
- Posts
- 2
how to append additional lines in an another file
Here the question.
orion-web.xml is a file which has mode nodes of which
<webapp>
</webapp>
is one of the it.
How can we add
<session-config>
<session-timeout>-1s</session-timeout>
<session-config>
Here is the resolution which is not working,
echo "<session-config>\n" > /tmp/somefile
echo "<session-timeout>-1s</session-timeout>\n" >> /tmp/somefile
echo "<session-config>\n" >> /tmp/somefile
sed -i "<webapp>/r /tmp/somefile" orion-web.xml
- 06-24-2011 #2
">" will dump to file, overwriting anything there
">>" will append to file, but at the very end
so, you could do:
cat >> ~/your_file << "EOF"
<session-config>
<session-timeout>-1s</session-timeout>
<session-config>
EOF
- 06-26-2011 #3Just Joined!
- Join Date
- Aug 2010
- Posts
- 2
Sorry can you please illustrate with actual commands what you mean to say?
Thanks
- 06-27-2011 #4Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,657
He did. The command he used is cat. His example uses cat to append everything inside the two EOF statements to the end of the file named ~/yourfile.
One issue: your session-config parameter needs to have a closing "/" at the beginning of the parameter name, in order to "close" the node.
I'm not entirely clear what you want your XML to look like, is it something like this?
Code:<webapp> <session-config> <session-timeout>-1s</session-timeout> </session-config> </webapp>


Reply With Quote

