title: Replacing second column using shell script
body: <p>I want to change the second column to upper case and I want to do it in shell script only. (no one liners!)</p>
  
  <pre><code>#!/bin/sh
  # read file line by line
  file="/pdump/country.000000.txt"
  while read line
  do
  mycol=`echo $line | awk -F"," '{print $2}'`
  mycol_new=`echo $mycol | tr "[:lower:]" [:upper:]`
  echo $line | awk -F"," '{print $1 "," $mycol_new "," $3 "," $4 "," $5 "," $6 "," $7 "," $8}'
  done &lt; $file
  </code></pre>
  
  <p>I am not able to replace the $2 with $mycol_new.
  Any suggestion?</p>