<?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 Re: Unix script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2602348#M855945</link>
    <description>Hi Rui,&lt;BR /&gt;&lt;BR /&gt;You could try something like&lt;BR /&gt;&lt;BR /&gt;/Begin/&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;# here hostname is the name of the remote machine &lt;BR /&gt;# username is the name of the user&lt;BR /&gt;# password is the password of the user username&lt;BR /&gt;&lt;BR /&gt;REMOTE=hostname&lt;BR /&gt;(sleep 5&lt;BR /&gt;echo username&lt;BR /&gt;sleep 5&lt;BR /&gt;echo  password&lt;BR /&gt;sleep 15&lt;BR /&gt;echo "ls -ald /tmp"&lt;BR /&gt;sleep 5&lt;BR /&gt;echo exit) |telnet $REMOTE&lt;BR /&gt;&lt;BR /&gt;/End/&lt;BR /&gt;&lt;BR /&gt;this is to connect to regular servers,  The same could be modified to connect to switches/routers etc.&lt;BR /&gt;&lt;BR /&gt;The other option is  to use expect and/or write perl program using expect.pm module.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-HTH&lt;BR /&gt;Ramesh</description>
    <pubDate>Fri, 26 Oct 2001 17:37:20 GMT</pubDate>
    <dc:creator>linuxfan</dc:creator>
    <dc:date>2001-10-26T17:37:20Z</dc:date>
    <item>
      <title>Unix script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2602345#M855942</link>
      <description>Greetings,&lt;BR /&gt;&lt;BR /&gt;Our HP-UX boxes are connected via the network to some equipment we manage.&lt;BR /&gt;We can open a telnet session on these equipments and enter some administrative commands:&lt;BR /&gt;&lt;BR /&gt;telnet x.x.x.x&lt;BR /&gt;5 (access level) &lt;BR /&gt;xxxxxxxxx (password) &lt;BR /&gt;Maint &lt;BR /&gt;&lt;BR /&gt;etc...&lt;BR /&gt;&lt;BR /&gt;exit &lt;BR /&gt;&lt;BR /&gt;I was asked to write a script to run on the HP-UX box to automate these procedures.&lt;BR /&gt;&lt;BR /&gt;Any suggestions?&lt;BR /&gt;&lt;BR /&gt;TIA,&lt;BR /&gt;&lt;BR /&gt;Kind Regards,&lt;BR /&gt;&lt;BR /&gt;Rui.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Oct 2001 16:51:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2602345#M855942</guid>
      <dc:creator>Rui Vilao</dc:creator>
      <dc:date>2001-10-26T16:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Unix script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2602346#M855943</link>
      <description>What type of equipment: servers, routers, switches?&lt;BR /&gt;For routers, switches, your best bet is to use expect and create an expect script that does this.  &lt;BR /&gt;Here are some examples:&lt;BR /&gt;&lt;A href="http://tcl.activestate.com:8002/resource/software/extensions/expect/" target="_blank"&gt;http://tcl.activestate.com:8002/resource/software/extensions/expect/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If its a server, I would suggest using remsh or ssh instead of passing passwords around.&lt;BR /&gt;&lt;BR /&gt;You can try passing commands directly to the telnet sessions by redirecting commands to it, but that is difficult as telnet is interactive. Expect is the best way to anticpate what response you will have and issue the commands at the appropriate time.</description>
      <pubDate>Fri, 26 Oct 2001 16:59:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2602346#M855943</guid>
      <dc:creator>Bernie Vande Griend</dc:creator>
      <dc:date>2001-10-26T16:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Unix script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2602347#M855944</link>
      <description>You can also use perl and there is an "Expect.pm" available. Perl will be stronger than any shell script.&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;&lt;BR /&gt;harry</description>
      <pubDate>Fri, 26 Oct 2001 17:03:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2602347#M855944</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-10-26T17:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Unix script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2602348#M855945</link>
      <description>Hi Rui,&lt;BR /&gt;&lt;BR /&gt;You could try something like&lt;BR /&gt;&lt;BR /&gt;/Begin/&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;# here hostname is the name of the remote machine &lt;BR /&gt;# username is the name of the user&lt;BR /&gt;# password is the password of the user username&lt;BR /&gt;&lt;BR /&gt;REMOTE=hostname&lt;BR /&gt;(sleep 5&lt;BR /&gt;echo username&lt;BR /&gt;sleep 5&lt;BR /&gt;echo  password&lt;BR /&gt;sleep 15&lt;BR /&gt;echo "ls -ald /tmp"&lt;BR /&gt;sleep 5&lt;BR /&gt;echo exit) |telnet $REMOTE&lt;BR /&gt;&lt;BR /&gt;/End/&lt;BR /&gt;&lt;BR /&gt;this is to connect to regular servers,  The same could be modified to connect to switches/routers etc.&lt;BR /&gt;&lt;BR /&gt;The other option is  to use expect and/or write perl program using expect.pm module.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-HTH&lt;BR /&gt;Ramesh</description>
      <pubDate>Fri, 26 Oct 2001 17:37:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2602348#M855945</guid>
      <dc:creator>linuxfan</dc:creator>
      <dc:date>2001-10-26T17:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Unix script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2602349#M855946</link>
      <description>First of all,&lt;BR /&gt;&lt;BR /&gt;Bernie, Harry and Ramesh, thanks a lot &lt;BR /&gt;for your contribution!&lt;BR /&gt;&lt;BR /&gt;Ramesh your solution is exactly what I was looking for.&lt;BR /&gt;&lt;BR /&gt;Many thanks,&lt;BR /&gt;&lt;BR /&gt;Kind Regards,&lt;BR /&gt;&lt;BR /&gt;Rui.</description>
      <pubDate>Sat, 27 Oct 2001 12:47:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2602349#M855946</guid>
      <dc:creator>Rui Vilao</dc:creator>
      <dc:date>2001-10-27T12:47:53Z</dc:date>
    </item>
  </channel>
</rss>

