Replacing text with shell script ending with an extension
<p>I need some inputs on how to achieve this:</p>

<p>I need to replace a text in a file, using shell script, the text which i need to replace ends with .ear, for example below:</p>

<p><code>/home/export/files/list/aa_bb_cc.ear</code></p>

<p>The shell script should replace the <code>aa_bb_cc.ear</code> with say, <code>replaced.ear</code>.</p>

<p>That is the line after substitution should be:</p>

<p><code>/home/export/files/list/replaced.ear</code></p>

<p>I did read online about this, and came to know about sed command. The problem which i have, is that i don't know before hand what the text to be replace would be, that is, i know the text to be replace would be something *.ear (in an attempt to match aa_bb_cc.ear)</p>

<p>Now, how can I do this? I tried to use "*" in sed however it didn't work</p>