title: wrong vi colors in BASH
body: <p>I am creating a basic script in vi. First, I typed the code in Notepad++ and when I was ready I copied it in vi. At some point, the colors change completly. For example the comment becomes purple.</p>
  
  <p>Searched for sintax errors and color interpretation but no succes. And also the script seems to work. Does anyone know what happened? </p>
  
  <pre><code>#find system and last database partition date
  system_date=`date '+%m%d%Y'`
  database_date=$(find_last_partition_date)
  
  # testing colour ...OK
  
  #convert system and last database partition dates to unix time
  
  # testing colour ...OK
  unix_system_date=`date -d $(sed -r 's#(..)(..)(....)#\1/\2/\3#' &lt;&lt;&lt;$system_date) +%s`
  
  #testing colour ...purple not blue
  
  unix_database_date=`date -d $(sed -r 's#(..)(..)(....)#\1/\2/\3#' &lt;&lt;&lt;$database_date) +%s`
  #testing colour
  
  #compare them to determine the initial parameter
  if (( unix_database_date &gt; unix_system_date )); then
          start_date=`date +"%m%d%Y" -d "${database_date:4}${database_date:0:4} + 1 day"`
  else
          start_date=`date '+%m%d%Y' -d "$actual_date+2 days"`
  fi
  
  
  cd /opt/data/apps/utils
  
  
  ################################################ 1st cycle ################################################
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/IM1BF.jpg" alt="vi colors"></p>