title: how to update xml file attribute with new value (add date time) in shell script?
body: <p>This is my xml below</p>
  
  <pre><code>&lt;Deployer exitOnError="true" sourceType="Repository"&gt;
  &lt;Projects projectPrefix=""&gt;
  &lt;SubProject description="" name="Ship" overwrite="false" type="Repository"&gt;
  &lt;/SubProject&gt;
  &lt;/Projects&gt;
  &lt;/Deployer&gt;
  </code></pre>
  
  <p>I want o change name="Ship" to name="Ship"+currentdatetime using shell script. Any help appreciated.</p>
  
  <p>I want to use sed or awk preferably (I dont want xmlstarlet as I cannot have xml tool box on my linux machine)</p>
  
  <p>Please find below, which I tried.</p>
  
  <pre><code>sed "/DeployerSpec&gt;/,&lt;Project description='' name='bstar' overwrite='false' type='Repository'&gt;" file
  
  sed -i 's:&lt;DeployerSpec exitOnError="true" sourceType="Repository"&gt;&lt;Projects projectPrefix=""&gt;&lt;Project description="" name="bstar" overwrite="false" type="Repository"&gt;&lt;/Project&gt;&lt;/Projects&gt;&lt;/DeployerSpec&gt;:&lt;DeployerSpec exitOnError="true" sourceType="Repository"&gt;&lt;Projects projectPrefix=""&gt;&lt;Project description="" name="bstar"+$(date+%x_%r) overwrite="false" type="Repository"&gt;&lt;/Project&gt;&lt;/Projects&gt;&lt;/DeployerSpec&gt;:' sample.xml
  
  sed -i.bak "s/&lt;Project description='' name='bstar' overwrite='false' type='Repository'&gt;/&lt;Project description='' name='bstar'+$(date +%x_%r) overwrite='false' type='Repository'&gt;/g" a.xml
  </code></pre>