title: How to replace 'colon' with 'underscore sign' in system MAC address?
body: <p>Here I created a bash script to get system mac address(05:1d:48:2f:60:h6) and assigning to a variable $phyAddr. I want to replace ':' to '_' from mac address and assigned to another variable $phyAddrConvert. Here its getting mac address only. Please help me to correct replacing 'col' to 'underscore sign'.</p>
  
  <pre><code>phyAddr=`ifconfig | grep 'eth0' | tr -s ' ' | cut -d ' ' -f5` 
  phyAddrConvert=$phyAddr | sed "s/:/_/g";
  echo $phyAddr                  # get output as 05:1d:48:2f:60:h6
  echo $phyAddrConvert           # nothing will get
  </code></pre>