title: Compare string with integer
body: <p>I want to compare a string with an integer and if it meets the given requirement then it would add that value to a text file.</p>
  
  <pre><code>test="$fqdn:$port"
  
  if [ $test = "$fqdn:443" ]; then
    echo "$test" | tee -a list.txt
  fi
  </code></pre>
  
  <p>In this case the variable <code>fqdn</code> would hold the value of a website and port would hold different port numbers but i only want to keep the ones that have a port of 443 after the <code>:</code> and append it to a new text file called <code>list.txt</code>.</p>
  
  <p>When I run this code I dont get the desired result for some reason. Can someone help? I am very new to programming in shell.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The values for the fqdn look like this:</p>
  
  <pre><code>something1.awesome.com
  something2.awesome.com
  something3.awesome.com
  something4.awesome.com
  something5.awesome.com
  ...
  </code></pre>
  
  <p>For the ports, it looks like this:</p>
  
  <pre><code>80
  8090
  443
  1090
  80
  80
  ...
  </code></pre>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>I did think about comparing only the $port with 443 but that wouldn't work in my case because the first fqdn goes with the first port and if the first fqdn:port equals something like fqdn:443 then add it to a text file.</p>