I want to combine two sed command in one and really don't know how to do it, I've tried multiple things without success.
For the result I want all slash between a specific tag to be replaced with backslash, what would result in :
<FilePath>a/b/c/d</FilePath> <OtherTags>Bob</OtherTags> <FilePath>1/2/3/4</FilePath>
<FilePath>a\b\c\d</FilePath> <OtherTags>Bob</OtherTags> <FilePath>1\2\3\4</FilePath>
I've found this command to change text between tags :
sed -i -e 's/\(<FilePath>\).*\(<\/FilePath>\)/<FilePath>TEXT_TO_REPLACE_BY<\/FilePath>/g' test.txt
But this command replace all the text... So what I want is to keep the text and only replace the slash with backslack with this kind of command :
sed -e 's/\\/\//g' test.txt
But I struggle to combine those two.
Thanks for your help.