title: "nc: getaddrinfo: nodename nor servname provided, or not known" with shell script
body: <p>I'm trying to communicate with my server and send telnet commands (login and logout again). For this I generated a shell skript and getting the error message "<strong>nc: getaddrinfo: nodename nor servname provided, or not known</strong>".</p>
  
  <p>The specific line is:</p>
  
  <pre><code>(sleep 1&amp;echo $login&amp;sleep 1&amp;echo $password&amp;sleep 1&amp;echo exit) | nc $IP 23 &gt; dump.out
  </code></pre>
  
  <p>When I execute this line (and for sure the export lines before) directly in the terminal it works without any problem, but when I execute the script, I get the error message.</p>
  
  <p>Can anyone help? Any help would be appreciated. Thanks in advance.</p>