title: Figure out Time Remaining in Linux
body: <p>Okay so the situation I am in is that I want to figure out exactly how many days are left until a specific date such as May 15, 2013. The date doesn't really matter but the idea is to figure out the amount of days left before reaching that day.</p>
  
  <p>I thought of doing something like this (pseudo code):</p>
  
  <pre><code>y=$end_year-$cur_year
  
  if [ y -ge 1 ]; then
     days=$y*365
  else
       continue
  fi
  
  if [ $end_month -gt $cur_month ]; then
       m=$end_month-$cur_month
  else
       contine
  fi
  
  if [ $end_day -gt $cur_day ]; then
      d=$end_day-$cur_day
  else
      continue
  fi
  
  result=$days+$m+$d
  </code></pre>
  
  <p>Now i don't know if there is an easier way to do this because I am very new to Linux and shell scripting so if there is a better way to do it please help me.</p>