<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Shell Scripting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripting/m-p/2621829#M38902</link>
    <description>Hello,&lt;BR /&gt;I am required to write a shell script for checking port availabilty. I am using telnet in the script. Can you tell me how I can send the  escape sequence ^] in the script, to come to the command mode. I need to do this to run the status command at the telnet prompt.&lt;BR /&gt;What I have done is something like this:&lt;BR /&gt;------------------------------&lt;BR /&gt;while true&lt;BR /&gt;&lt;BR /&gt;do&lt;BR /&gt;telnet &amp;lt;&amp;lt; EOF&lt;BR /&gt;open hostname port&lt;BR /&gt;???? ^]&lt;BR /&gt;status &amp;gt;&amp;gt; filename&lt;BR /&gt;close&lt;BR /&gt;EOF&lt;BR /&gt;done&lt;BR /&gt;------------------------------&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Jayant</description>
    <pubDate>Thu, 29 Nov 2001 03:52:12 GMT</pubDate>
    <dc:creator>Jayant Butte</dc:creator>
    <dc:date>2001-11-29T03:52:12Z</dc:date>
    <item>
      <title>Shell Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripting/m-p/2621829#M38902</link>
      <description>Hello,&lt;BR /&gt;I am required to write a shell script for checking port availabilty. I am using telnet in the script. Can you tell me how I can send the  escape sequence ^] in the script, to come to the command mode. I need to do this to run the status command at the telnet prompt.&lt;BR /&gt;What I have done is something like this:&lt;BR /&gt;------------------------------&lt;BR /&gt;while true&lt;BR /&gt;&lt;BR /&gt;do&lt;BR /&gt;telnet &amp;lt;&amp;lt; EOF&lt;BR /&gt;open hostname port&lt;BR /&gt;???? ^]&lt;BR /&gt;status &amp;gt;&amp;gt; filename&lt;BR /&gt;close&lt;BR /&gt;EOF&lt;BR /&gt;done&lt;BR /&gt;------------------------------&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Jayant</description>
      <pubDate>Thu, 29 Nov 2001 03:52:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripting/m-p/2621829#M38902</guid>
      <dc:creator>Jayant Butte</dc:creator>
      <dc:date>2001-11-29T03:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripting/m-p/2621830#M38903</link>
      <description>Hello&lt;BR /&gt;&lt;BR /&gt;In my opinion, shell scripts are a bad tool for your job. You may want to write a small perl program to open a socket to the desired port. If you really don't want to write a program, you cake nmap (&lt;A href="http://hpux.ee.ualberta.ca/hppd/hpux/Networking/Admin/nmap-2.53/)" target="_blank"&gt;http://hpux.ee.ualberta.ca/hppd/hpux/Networking/Admin/nmap-2.53/)&lt;/A&gt; to do the job for you like this:&lt;BR /&gt;&lt;BR /&gt;(suppose you want to test port 22 on host sshhost)&lt;BR /&gt;&lt;BR /&gt;if &lt;BR /&gt;nmap sshhost -p 22 | grep -i '22/tcp.*open' &amp;gt;/dev/null 2&amp;gt;&amp;amp;1; then&lt;BR /&gt;    echo Port is open&lt;BR /&gt;else&lt;BR /&gt;    echo Port is closed&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Shameless plug: You may try a  small perl monitoring tool I wrote to monitor ports and other services at &lt;A href="http://www.paganini.net/angel" target="_blank"&gt;http://www.paganini.net/angel&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope it helps,&lt;BR /&gt;Paga&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Nov 2001 03:59:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripting/m-p/2621830#M38903</guid>
      <dc:creator>Marco Paganini</dc:creator>
      <dc:date>2001-11-29T03:59:27Z</dc:date>
    </item>
  </channel>
</rss>

