title: Replace a string in a file with contents copied from another file
body: <p>I have figured out and tried replacing strings with the help of <code>gsed -i</code> command like this:</p>
  
  <pre><code>gsed -i 's/sdkUniqueKey=""/sdkUniqueKey="123"/g' AppConstants.txt
  </code></pre>
  
  <p>Now I want to do the same operation on another string in my file but as my question states, I need to copy the contents from a different file first and then replace a string, something like:</p>
  
  <pre><code>gsed -i 's/sdkPrivateKey=""/sdkPrivateKey="contentsCopiedFromAnotherFile"/g' AppConstants.txt
  </code></pre>
  
  <p>One more thing, the contents (to be copied), have next line and white space in it, which I would like to remove before copying. Also it has backslash and forward slashes, hope they don't create any issues while replacing the content). Here is what I am trying to copy:</p>
  
  <pre><code>-----BEGIN PRIVATE KEY-----
  MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDNGillPEfz8d7W
  0fyJejF9AYeo8OowcdOcxrpzs4IiXCwPEP1MOHAaOwGTdMwSAeQjw9WOYpE1q+DU
  I+Zhh4DVUR8dIdYQtXe+oK/QfhVQMJ3AjTKRvhUmFciGwxXlnLBIkN/ePplNdq9Z
  Y5DrSR0lE8X2dD+ZRAkQRpsY8TE48b9f443sbsU4sMvNaxd2XTxe2TLYRvB00w6Q
  3lqZiKLzttINBCPoCjhJwBdhcF/LHsCmYhfElPqJxH27BTGBOnbICdmazdnChXQg
  3hhsbJmnNDe17Spw0lY
  -----END PRIVATE KEY-----
  </code></pre>
  
  <p>I am able to copy the contents of a file into a variable as well:</p>
  
  <pre><code>contents ="`cat fileToBeRead`"
  </code></pre>
  
  <p>All I need is to remove white spaces and new lines from this string and use this "<code>contents</code>" variable in my <code>gsed</code> command</p>