title: Replacing a string in a file using bash shell script
body: <p>I want to find a string in a file, do some operation and put back the string in the file. Given below is the example on what I need:</p>
  
  <pre><code>$ cat sample.txt
  TimeStamp-&gt; 123456 Name-&gt; ABC Mail-&gt; abc@123.com
  TimeStamp-&gt; 23456 Name-&gt; XYZ Age-&gt; 25
  </code></pre>
  
  <p>Let me modify my question. I want to read that string/number after <code>TimeStamp-&gt;</code>, modify the same based on the requirement and put it back to get in the same file or create a new file. Let's say the operation is multiply by -1.</p>
  
  <p>Expected output is:</p>
  
  <pre><code>TimeStamp-&gt; -123456 Name-&gt; ABC Mail-&gt; abc@123.com
  TimeStamp-&gt; -23456 Name-&gt; XYZ Age-&gt; 25
  </code></pre>