title: checking if current time is between two times in HHmmss format in shell script
body: <p>I have a main script that calls doSomeWork.sh each and every 10 mins. </p>
  
  <p>But the condition is that the doSomeWork.sh should not run between 23:30:00 to 03:00:00. </p>
  
  <p>I have made my script to look something like the below.</p>
  
  <pre><code>#!/bin/ksh
  prodStartTime="030000"
  prodEndTime="233000"
  
  currentTime=`date +"%H%M%S"`
  echo $prodStartTime
  echo $prodEndTime
  echo $currentTime
  while true
  do
  if [[ $currentTime -ge $prodStartTime &amp;&amp; $currentTime -le $prodEndTime ]];
  then
        ./doSomeWork.sh
  else
   echo Do Nothing
  fi
  sleep 600
  done
  </code></pre>
  
  <p>UPDATE: Now I have the code working by checking production timings instead of night mode timings(See edit history). But looks like my script is considering the values as Octal as suggested by "twalberg" in the comments. Could someone help me how to take care of these values?</p>
  
  <p>I simply need a way to ensure that my script runs between the specified time span.</p>