<?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: expect giving problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990296#M923673</link>
    <description>#!../expect --&lt;BR /&gt;# telnet-cwd - telnet but with same directory&lt;BR /&gt;#&lt;BR /&gt;# You can extend this idea to save any arbitrary information across telnet&lt;BR /&gt;# Don Libes -  Oct 17, 1991.&lt;BR /&gt;&lt;BR /&gt;set prompt "(%|#|\\$) $"  ;# default prompt&lt;BR /&gt;catch {set prompt $env(EXPECT_PROMPT)}&lt;BR /&gt;&lt;BR /&gt;eval spawn telnet $argv&lt;BR /&gt;interact -o -nobuffer -re $prompt return&lt;BR /&gt;send "cd [pwd]\r"&lt;BR /&gt;interact&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 05 Jun 2003 18:16:34 GMT</pubDate>
    <dc:creator>curt larson_1</dc:creator>
    <dc:date>2003-06-05T18:16:34Z</dc:date>
    <item>
      <title>expect giving problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990291#M923668</link>
      <description>Anybody can send me a expect script for logging into the system.  &lt;BR /&gt;this following script is failing&lt;BR /&gt; &lt;BR /&gt; set username testuser&lt;BR /&gt; set oldpasswd tesyy344&lt;BR /&gt; set newpasswd 1Xe7tfyz&lt;BR /&gt; set timeout_org $timeout&lt;BR /&gt; set timeout 3&lt;BR /&gt; &lt;BR /&gt; set prompt "(%|#|\\\$) "&lt;BR /&gt; &lt;BR /&gt; spawn rlogin -l $username localhost&lt;BR /&gt; &lt;BR /&gt; expect "assword: " {&lt;BR /&gt;     send "$oldpasswd\r"&lt;BR /&gt; } timeout {&lt;BR /&gt;     set timeout $timeout_org&lt;BR /&gt;     send_user "Time Out\n"&lt;BR /&gt;     exit&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;Any suggestions !</description>
      <pubDate>Thu, 05 Jun 2003 16:44:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990291#M923668</guid>
      <dc:creator>prasad_15</dc:creator>
      <dc:date>2003-06-05T16:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: expect giving problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990292#M923669</link>
      <description>Expect inclues a number of examples.  The README file in the example directory contains a complete list as well as full explanations about each of the examples. The example called "passmass" logs into another system and changes the password.  You can probably modify this for your requirements.&lt;BR /&gt;&lt;BR /&gt;The README file in the distribution also describes the locaton of the Expect archive which holds even more scripts. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://expect.nist.gov/FAQ.html" target="_blank"&gt;http://expect.nist.gov/FAQ.html&lt;/A&gt;&lt;BR /&gt;is the url for the expect FAQ&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://expect.nist.gov" target="_blank"&gt;http://expect.nist.gov&lt;/A&gt;&lt;BR /&gt;is the url for the expect home page.&lt;BR /&gt;&lt;BR /&gt;the home page includes links to the examples that are included with expect.</description>
      <pubDate>Thu, 05 Jun 2003 18:05:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990292#M923669</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-06-05T18:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: expect giving problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990293#M923670</link>
      <description>Here is a script I've used many times... it works perfectly.. you need to edit you username and password.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Jun 2003 18:13:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990293#M923670</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-06-05T18:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: expect giving problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990294#M923671</link>
      <description>#!/depot/path/expect --&lt;BR /&gt;# xrlogin - rlogin but with current DISPLAY&lt;BR /&gt;#&lt;BR /&gt;# You can extend this idea to save any arbitrary information across rlogin&lt;BR /&gt;# Don Libes -  Oct 17, 1991.&lt;BR /&gt;&lt;BR /&gt;if {[llength $argv] != 1} {&lt;BR /&gt; puts "usage: xrlogin remotehost"&lt;BR /&gt; exit&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;set prompt "(%|#|\\$) $"  ;# default prompt&lt;BR /&gt;catch {set prompt $env(EXPECT_PROMPT)}&lt;BR /&gt;&lt;BR /&gt;set timeout -1&lt;BR /&gt;eval spawn rlogin $argv&lt;BR /&gt;expect eof exit -re $prompt&lt;BR /&gt;if {[string match "unix:0.0" $env(DISPLAY)]} {&lt;BR /&gt; set env(DISPLAY) "[exec hostname].[exec domainname]:0.0\r"&lt;BR /&gt;}&lt;BR /&gt;send "setenv DISPLAY $env(DISPLAY)\r"&lt;BR /&gt;interact&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Jun 2003 18:14:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990294#M923671</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-06-05T18:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: expect giving problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990295#M923672</link>
      <description>just a note... the script i attached was made using autoexpect from my linux box.  autoexpect comes with expect....&lt;BR /&gt;&lt;BR /&gt;type:&lt;BR /&gt;&lt;BR /&gt;autoexpect -f &lt;FILENAME&gt; telnet servername&lt;BR /&gt;&lt;BR /&gt;then commense to logging in and doing your thing.  when you hit ^d (control d) it writes to &lt;FILENAME&gt;.  you will then need to do some editing of the file and remove the datestamp and a few other lines... use my script attached in my earlier message as an example.&lt;/FILENAME&gt;&lt;/FILENAME&gt;</description>
      <pubDate>Thu, 05 Jun 2003 18:16:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990295#M923672</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-06-05T18:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: expect giving problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990296#M923673</link>
      <description>#!../expect --&lt;BR /&gt;# telnet-cwd - telnet but with same directory&lt;BR /&gt;#&lt;BR /&gt;# You can extend this idea to save any arbitrary information across telnet&lt;BR /&gt;# Don Libes -  Oct 17, 1991.&lt;BR /&gt;&lt;BR /&gt;set prompt "(%|#|\\$) $"  ;# default prompt&lt;BR /&gt;catch {set prompt $env(EXPECT_PROMPT)}&lt;BR /&gt;&lt;BR /&gt;eval spawn telnet $argv&lt;BR /&gt;interact -o -nobuffer -re $prompt return&lt;BR /&gt;send "cd [pwd]\r"&lt;BR /&gt;interact&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Jun 2003 18:16:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990296#M923673</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-06-05T18:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: expect giving problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990297#M923674</link>
      <description>&lt;BR /&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;Finally what I was able to do is as below. &lt;BR /&gt;It takes both cases&lt;BR /&gt;1- when the password expires&lt;BR /&gt;2- whenever you need changing the password&lt;BR /&gt;&lt;BR /&gt;Any suggestions to improve this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/local/bin/expect -f&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;#USAGE big_exp.exp [host] [username] [oldpw] [newpw]&lt;BR /&gt;&lt;BR /&gt;set host     [lindex $argv 0]  &lt;BR /&gt;set username [lindex $argv 1] &lt;BR /&gt;set oldpw    [lindex $argv 2] &lt;BR /&gt;set newpw    [lindex $argv 3] &lt;BR /&gt;&lt;BR /&gt;set pw_stat            0 ;# set to 1 for expired passwords&lt;BR /&gt;&lt;BR /&gt;log_file /tmp/JUNK&lt;BR /&gt;&lt;BR /&gt;set force_conservative 0  ;# set to 1 to force conservative mode even if&lt;BR /&gt;     ;# script wasn't run conservatively originally&lt;BR /&gt;if {$force_conservative} {&lt;BR /&gt; set send_slow {1 .1}&lt;BR /&gt; proc send {ignore arg} {&lt;BR /&gt;  sleep .1&lt;BR /&gt;  exp_send -s -- $arg&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;set timeout -1&lt;BR /&gt;&lt;BR /&gt;spawn rlogin $host -l $username &lt;BR /&gt;match_max 100000&lt;BR /&gt;&lt;BR /&gt;expect {&lt;BR /&gt;&lt;BR /&gt; -exact "Password: " {&lt;BR /&gt;  send  "$oldpw\r"&lt;BR /&gt;  &lt;BR /&gt;  send "$newpw\r"&lt;BR /&gt;  send  "passwd $username\n"&lt;BR /&gt;  expect "password:"                                  &lt;BR /&gt;  send "$oldpw\r"                                  &lt;BR /&gt;  expect "password:"                                  &lt;BR /&gt;  send "$newpw\r"   &lt;BR /&gt;  expect "password:"                                  &lt;BR /&gt;  send "$newpw\r"   &lt;BR /&gt;  }&lt;BR /&gt;   -re "expired" {&lt;BR /&gt;  send "$oldpw\r"                                  &lt;BR /&gt;  send "$newpw\r"   &lt;BR /&gt;  send "$newpw\r"   &lt;BR /&gt;  }&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;send  "exit\n"&lt;BR /&gt;send  "exit\n"&lt;BR /&gt;expect eof&lt;BR /&gt;&lt;BR /&gt;Thank You All.</description>
      <pubDate>Thu, 05 Jun 2003 20:56:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/expect-giving-problem/m-p/2990297#M923674</guid>
      <dc:creator>prasad_15</dc:creator>
      <dc:date>2003-06-05T20:56:22Z</dc:date>
    </item>
  </channel>
</rss>

