title: Bash read txt and apply conditions to variables
body: <p>May ask which is correct way to read a file, store the variables into array, and be able to compare them?
  PHP user interface writes an txt with 3 variables: weeks's day, hour and minute, i need to read them into bash and compare with the current time to determinate if is to do something or not.
  Currently i'm not sure about how i read and store the variables inside a bash array, and i get a lot of issues about how to calculate the condition to determinate if the current time is major then the txt time.
  In my case a bash script is running while ever, sometime it finish to do something and need to check if the current time is major then the txt's time to choose what to do next.</p>
  <p>The input txt file, an example of the schedule date</p>
  <pre><code>2
  20
  45
  </code></pre>
  <p>The bash script</p>
  <pre><code>#!/bin/bash
  #CHECKTIME
  
  
  #GET TIME
  
  IFS=- read -r DAY HOUR MINUTE &lt; &lt;(date +%e-%H-%M)
  echo $DAY
  echo $HOUR
  echo $MINUTE
  
  
  #READ EVENT TIME
  while IFS= read -r line; do
      echo &quot;$line&quot;
  done &lt; myFile.txt
  echo $line[0]
  echo $line[1]
  echo $line[2]
  
  
  if [ &quot;$DAY&quot; =  &quot;$line[0]&quot; ] &amp;&amp; [ &quot;$HOUR&quot; -ge  &quot;$line[1]&quot;]  &amp;&amp; [ &quot;$MINUTE&quot; &gt; &quot;$line[2]&quot;]
  then
      echo &quot;do event &quot;
  
  else
          echo &quot;don't do event&quot;
  #echo $name
  fi
  </code></pre>
  <p>Do i need:
  if week's day is equal and hours is major do it, else don't do it, but if week's day and hour are equal check also for minutes equal or major..
  ?</p>
  <p>However im not sure about how i read and store variables into array and how to write this condition in BASH, may ask help for?
  Thanks</p>