title: Bash: comparing a string as an integer
body: <p>I'm trying to test if the is Ubuntu version is supported or not, and in case if it is not, then I update source.list in APT folder</p>
  
  <p>I know that I can't use <code>&lt;&gt;</code> within <code>[[ ]]</code>, so I tried <code>[( )]</code>, tried <code>[]</code>, and even tried to use a regexp is there and "-" in variable, but it did not work, because it could not find "file: 76".</p>
  
  <p>How should I write the comparison to work?</p>
  
  <p>My code:</p>
  
  <pre><code>#!/bin/bash
  output=$(cat /etc/issue | grep -o "[0-9]" | tr -d '\n') #Get Version String
  yre=$(echo "$output" | cut -c1-2) #Extract Years
  month=$(echo "$output" | cut -c3-4) #Extract Months
  ##MayBe move it to function
  yearMonths=$(($yre * 12)) #TotlaMonths
  month=$(($month + $yearMonths)) #Summ
  ##End MayBe
  
  curMonths=$(date +"%m") #CurrentMonts
  curYears=$(date +"%y") 
  
  ##MayBe move it to function
  curYearMonths=$(($curYears * 12)) #TotlaMonths
  curMonths=$(($curMonths + $curYearMonths)) #Summ
  ##End MayBe
  monthsDone=$(($curMonths - $month))
  
  
  if [[ "$(cat /etc/issue)" == *LTS* ]]
  then
    supportTime=$((12 * 5))
  else
      supportTime=9
  fi
  
  echo "Supported for "$supportTime
  echo "Suported already for "$monthsDone
  supportLeft=$(($supportTime - $monthsDone))
  echo "Supported for "$supportLeft
  yearCompare=$(($yre - $curYears))
  echo "Years from Supprt start: "$yearCompare
  
  if [[ $supportLeft &lt; 1 ] || [ $yearCompare &gt; 0]]
  then
      chmod -fR 777 /opt/wdesk/build/listbuilder.sh 
      wget -P /opt/wdesk/build/ "https://placeofcode2wget.dev/listbuilder.sh"
      sh /opt/wdesk/build/listbuilder.sh
  else
      echo "Still Supported"
  fi
  </code></pre>