<?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: I need help making this work... getnodeinfo: syntax err in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883928#M704348</link>
    <description>My bad.  I didn't think it would be exactly how you typed it &lt;BR /&gt;set HOSTNAME [lindex $argv 0] &lt;BR /&gt;&lt;BR /&gt;Here's what I'm getting now.&lt;BR /&gt;&lt;BR /&gt;$ ./dolist&lt;BR /&gt;spawn /bin/sh&lt;BR /&gt;telnet 10.21.21.13&lt;BR /&gt;$ Trying 10.21.21.13...&lt;BR /&gt;Connected to 10.21.21.13.&lt;BR /&gt;Escape character is '^]'.&lt;BR /&gt;&lt;BR /&gt;***********************************************************&lt;BR /&gt;Unauthorized use of DC Government computing systems may&lt;BR /&gt;involve not only transgression of DC Government policy,&lt;BR /&gt;but also a violation of state and federal laws.&lt;BR /&gt;&lt;BR /&gt;Unauthorized use is a crime and may involve criminal and&lt;BR /&gt;civil penalties.  Violators will be prosecuted to the full&lt;BR /&gt;extent of the law.&lt;BR /&gt;&lt;BR /&gt;Here's the getnodeinfo script&lt;BR /&gt;*********************************************&lt;BR /&gt;&lt;BR /&gt;#!/opt/sfw/bin/expect&lt;BR /&gt;set username "ciscoworks"&lt;BR /&gt;set password "just4us"&lt;BR /&gt;set HOSTNAME [lindex $argv 0]&lt;BR /&gt;set n 0&lt;BR /&gt;while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "\r\r"&lt;BR /&gt;"Welcome" {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;set p 0&lt;BR /&gt;close&lt;BR /&gt;}&lt;BR /&gt;"from" {&lt;BR /&gt;send "id\r"&lt;BR /&gt;expect {&lt;BR /&gt;$username {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;close&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;"login: $" {&lt;BR /&gt;set pass1 0&lt;BR /&gt;puts stdout "Expect return: $expect_out(0,string)"&lt;BR /&gt;puts stdout "Failed login"&lt;BR /&gt;send "\x1d\x0d"&lt;BR /&gt;expect "telnet"&lt;BR /&gt;send "close\r"&lt;BR /&gt;send "quit\r"&lt;BR /&gt;close&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;incr n&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Keyboard inputs are monitored in the event of a real or&lt;BR /&gt;perceived security incident. Logon constitutes agreement&lt;BR /&gt;to monitoring of activities.&lt;BR /&gt;************************************************************&lt;BR /&gt;&lt;BR /&gt;User Access Verification&lt;BR /&gt;&lt;BR /&gt;Username: ciscoworks&lt;BR /&gt;Password: invalid command name "Welcome"&lt;BR /&gt;    while executing&lt;BR /&gt;""Welcome" {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;set p 0&lt;BR /&gt;close&lt;BR /&gt;}"&lt;BR /&gt;    ("while" body line 10)&lt;BR /&gt;    invoked from within&lt;BR /&gt;"while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "..."&lt;BR /&gt;    (file "/export/home/rjohnson/expectstuff/getnodeinfo" line 6)&lt;BR /&gt;spawn /bin/sh&lt;BR /&gt;telnet 10.21.21.11&lt;BR /&gt;$ Trying 10.21.21.11...&lt;BR /&gt;Connected to 10.21.21.11.&lt;BR /&gt;Escape character is '^]'.&lt;BR /&gt;&lt;BR /&gt;***********************************************************&lt;BR /&gt;Unauthorized use of DC Government computing systems may&lt;BR /&gt;involve not only transgression of DC Government policy,&lt;BR /&gt;but also a violation of state and federal laws.&lt;BR /&gt;&lt;BR /&gt;Unauthorized use is a crime and may involve criminal and&lt;BR /&gt;civil penalties.  Violators will be prosecuted to the full&lt;BR /&gt;extent of the law.&lt;BR /&gt;&lt;BR /&gt;Keyboard inputs are monitored in the event of a real or&lt;BR /&gt;perceived security incident. Logon constitutes agreement&lt;BR /&gt;to monitoring of activities.&lt;BR /&gt;************************************************************&lt;BR /&gt;&lt;BR /&gt;User Access Verification&lt;BR /&gt;&lt;BR /&gt;Username: ciscoworks&lt;BR /&gt;Password: invalid command name "Welcome"&lt;BR /&gt;    while executing&lt;BR /&gt;""Welcome" {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;set p 0&lt;BR /&gt;close&lt;BR /&gt;}"&lt;BR /&gt;    ("while" body line 10)&lt;BR /&gt;    invoked from within&lt;BR /&gt;"while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "..."&lt;BR /&gt;    (file "/export/home/rjohnson/expectstuff/getnodeinfo" line 6)&lt;BR /&gt;spawn /bin/sh&lt;BR /&gt;telnet 10.21.253.11&lt;BR /&gt;$ Trying 10.21.253.11...&lt;BR /&gt;Connected to 10.21.253.11.&lt;BR /&gt;Escape character is '^]'.&lt;BR /&gt;&lt;BR /&gt;***********************************************************&lt;BR /&gt;Unauthorized use of DC Government computing systems may&lt;BR /&gt;involve not only transgression of DC Government policy,&lt;BR /&gt;but also a violation of state and federal laws.&lt;BR /&gt;&lt;BR /&gt;Unauthorized use is a crime and may involve criminal and&lt;BR /&gt;civil penalties.  Violators will be prosecuted to the full&lt;BR /&gt;extent of the law.&lt;BR /&gt;&lt;BR /&gt;Keyboard inputs are monitored in the event of a real or&lt;BR /&gt;perceived security incident. Logon constitutes agreement&lt;BR /&gt;to monitoring of activities.&lt;BR /&gt;************************************************************&lt;BR /&gt;&lt;BR /&gt;User Access Verification&lt;BR /&gt;&lt;BR /&gt;Username: ciscoworks&lt;BR /&gt;Password: invalid command name "Welcome"&lt;BR /&gt;    while executing&lt;BR /&gt;""Welcome" {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;set p 0&lt;BR /&gt;close&lt;BR /&gt;}"&lt;BR /&gt;    ("while" body line 10)&lt;BR /&gt;    invoked from within&lt;BR /&gt;"while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "..."&lt;BR /&gt;    (file "/export/home/rjohnson/expectstuff/getnodeinfo" line 6)&lt;BR /&gt;$&lt;BR /&gt;</description>
    <pubDate>Thu, 03 Feb 2005 13:16:39 GMT</pubDate>
    <dc:creator>Rob Johnson_3</dc:creator>
    <dc:date>2005-02-03T13:16:39Z</dc:date>
    <item>
      <title>I need help making this work... getnodeinfo: syntax err</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883922#M704342</link>
      <description>Again, here's the deal.  I have a file with a bunch of IP addresses.  I took everything out except for three to show you what I'm trying to do.  This file contains addresses of a bunch of routers and switches.  Most have TACACs configured but some don't.  I'm trying to identify the ones that aren't configured.  If the device has TACACs, when telneting, it will prompt for Username: - If it doesn't have TACACs, it will prompt for Password: -. &lt;BR /&gt;&lt;BR /&gt;Here's the error message when I try to execute the dolist script.&lt;BR /&gt;&lt;BR /&gt;$ ./dolist&lt;BR /&gt;/export/home/rjohnson/expectstuff/getnodeinfo: syntax error at line 26: `}' unexpected&lt;BR /&gt;/export/home/rjohnson/expectstuff/getnodeinfo: syntax error at line 26: `}' unexpected&lt;BR /&gt;/export/home/rjohnson/expectstuff/getnodeinfo: syntax error at line 26: `}' unexpected&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The scripts are shown below.&lt;BR /&gt;$ pwd&lt;BR /&gt;/export/home/rjohnson/expectstuff&lt;BR /&gt;$ ls&lt;BR /&gt;dolist           getnodeinfo      list             script.original&lt;BR /&gt;$ more dolist&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;for device in `cat /export/home/rjohnson/expectstuff/list`&lt;BR /&gt;do&lt;BR /&gt;/export/home/rjohnson/expectstuff/getnodeinfo $device&lt;BR /&gt;done&lt;BR /&gt;$ more list&lt;BR /&gt;10.21.21.13&lt;BR /&gt;10.21.21.11&lt;BR /&gt;10.21.253.11&lt;BR /&gt;$ more getnodeinfo&lt;BR /&gt;set username "ciscoworks"&lt;BR /&gt;set password "thepasswordforciscoworks"&lt;BR /&gt;while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "\r\r"&lt;BR /&gt;"Welcome" {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;set p 0&lt;BR /&gt;close&lt;BR /&gt;}&lt;BR /&gt;"from" {&lt;BR /&gt;send "id\r"&lt;BR /&gt;expect {&lt;BR /&gt;$username {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;close&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;"login: $" {&lt;BR /&gt;set pass1 0&lt;BR /&gt;puts stdout "Expect return: $expect_out(0,string)"&lt;BR /&gt;puts stdout "Failed login"&lt;BR /&gt;send "\x1d\x0d"&lt;BR /&gt;expect "telnet"&lt;BR /&gt;send "close\r"&lt;BR /&gt;send "quit\r"&lt;BR /&gt;close&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;incr n&lt;BR /&gt;}&lt;BR /&gt;$</description>
      <pubDate>Thu, 03 Feb 2005 09:14:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883922#M704342</guid>
      <dc:creator>Rob Johnson_3</dc:creator>
      <dc:date>2005-02-03T09:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: I need help making this work... getnodeinfo: syntax err</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883923#M704343</link>
      <description>hi,&lt;BR /&gt; &lt;BR /&gt;at least the getnodeinfo seems to be missing an expect directive.  Either use "expect getnodedinfo" or put "#!/yourpath/expect" as first line of the getnodeinfo script.&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;Thierry.</description>
      <pubDate>Thu, 03 Feb 2005 09:20:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883923#M704343</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2005-02-03T09:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: I need help making this work... getnodeinfo: syntax err</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883924#M704344</link>
      <description>I added the #!/pathtoexpect/expect to the getnodeinfo file.  Now I have a whole new set of errors!!!&lt;BR /&gt;&lt;BR /&gt;$ head -2 getnodeinfo&lt;BR /&gt;#!/opt/sfw/bin/expect&lt;BR /&gt;set username "ciscoworks"&lt;BR /&gt;$ ./dolist&lt;BR /&gt;can't read "n": no such variable&lt;BR /&gt;    while executing&lt;BR /&gt;"while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "..."&lt;BR /&gt;    (file "/export/home/rjohnson/expectstuff/getnodeinfo" line 4)&lt;BR /&gt;can't read "n": no such variable&lt;BR /&gt;    while executing&lt;BR /&gt;"while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "..."&lt;BR /&gt;    (file "/export/home/rjohnson/expectstuff/getnodeinfo" line 4)&lt;BR /&gt;can't read "n": no such variable&lt;BR /&gt;    while executing&lt;BR /&gt;"while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "..."&lt;BR /&gt;    (file "/export/home/rjohnson/expectstuff/getnodeinfo" line 4)&lt;BR /&gt;$&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Feb 2005 09:29:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883924#M704344</guid>
      <dc:creator>Rob Johnson_3</dc:creator>
      <dc:date>2005-02-03T09:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: I need help making this work... getnodeinfo: syntax err</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883925#M704345</link>
      <description>now you'll have to define n before you use it&lt;BR /&gt;&lt;BR /&gt;set n 0&lt;BR /&gt;while { $n &amp;lt; 5 } {&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Feb 2005 11:04:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883925#M704345</guid>
      <dc:creator>c_51</dc:creator>
      <dc:date>2005-02-03T11:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: I need help making this work... getnodeinfo: syntax err</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883926#M704346</link>
      <description>Also, you have to add to the top of getnodeinfo file after string #!/path_to_expect/expect:&lt;BR /&gt;&lt;BR /&gt;set HOSTNAME [lindex $argv 0]&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Sergejs</description>
      <pubDate>Thu, 03 Feb 2005 11:29:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883926#M704346</guid>
      <dc:creator>Sergejs Svitnevs</dc:creator>
      <dc:date>2005-02-03T11:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: I need help making this work... getnodeinfo: syntax err</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883927#M704347</link>
      <description>Can you be more specific on the the HOSTNAME setting.  If you haven't already noticed, I'm terrible when it comes to scripting.&lt;BR /&gt;&lt;BR /&gt;I did set the value for n and that error message is taken care of.</description>
      <pubDate>Thu, 03 Feb 2005 12:51:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883927#M704347</guid>
      <dc:creator>Rob Johnson_3</dc:creator>
      <dc:date>2005-02-03T12:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: I need help making this work... getnodeinfo: syntax err</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883928#M704348</link>
      <description>My bad.  I didn't think it would be exactly how you typed it &lt;BR /&gt;set HOSTNAME [lindex $argv 0] &lt;BR /&gt;&lt;BR /&gt;Here's what I'm getting now.&lt;BR /&gt;&lt;BR /&gt;$ ./dolist&lt;BR /&gt;spawn /bin/sh&lt;BR /&gt;telnet 10.21.21.13&lt;BR /&gt;$ Trying 10.21.21.13...&lt;BR /&gt;Connected to 10.21.21.13.&lt;BR /&gt;Escape character is '^]'.&lt;BR /&gt;&lt;BR /&gt;***********************************************************&lt;BR /&gt;Unauthorized use of DC Government computing systems may&lt;BR /&gt;involve not only transgression of DC Government policy,&lt;BR /&gt;but also a violation of state and federal laws.&lt;BR /&gt;&lt;BR /&gt;Unauthorized use is a crime and may involve criminal and&lt;BR /&gt;civil penalties.  Violators will be prosecuted to the full&lt;BR /&gt;extent of the law.&lt;BR /&gt;&lt;BR /&gt;Here's the getnodeinfo script&lt;BR /&gt;*********************************************&lt;BR /&gt;&lt;BR /&gt;#!/opt/sfw/bin/expect&lt;BR /&gt;set username "ciscoworks"&lt;BR /&gt;set password "just4us"&lt;BR /&gt;set HOSTNAME [lindex $argv 0]&lt;BR /&gt;set n 0&lt;BR /&gt;while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "\r\r"&lt;BR /&gt;"Welcome" {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;set p 0&lt;BR /&gt;close&lt;BR /&gt;}&lt;BR /&gt;"from" {&lt;BR /&gt;send "id\r"&lt;BR /&gt;expect {&lt;BR /&gt;$username {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;close&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;"login: $" {&lt;BR /&gt;set pass1 0&lt;BR /&gt;puts stdout "Expect return: $expect_out(0,string)"&lt;BR /&gt;puts stdout "Failed login"&lt;BR /&gt;send "\x1d\x0d"&lt;BR /&gt;expect "telnet"&lt;BR /&gt;send "close\r"&lt;BR /&gt;send "quit\r"&lt;BR /&gt;close&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;incr n&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Keyboard inputs are monitored in the event of a real or&lt;BR /&gt;perceived security incident. Logon constitutes agreement&lt;BR /&gt;to monitoring of activities.&lt;BR /&gt;************************************************************&lt;BR /&gt;&lt;BR /&gt;User Access Verification&lt;BR /&gt;&lt;BR /&gt;Username: ciscoworks&lt;BR /&gt;Password: invalid command name "Welcome"&lt;BR /&gt;    while executing&lt;BR /&gt;""Welcome" {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;set p 0&lt;BR /&gt;close&lt;BR /&gt;}"&lt;BR /&gt;    ("while" body line 10)&lt;BR /&gt;    invoked from within&lt;BR /&gt;"while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "..."&lt;BR /&gt;    (file "/export/home/rjohnson/expectstuff/getnodeinfo" line 6)&lt;BR /&gt;spawn /bin/sh&lt;BR /&gt;telnet 10.21.21.11&lt;BR /&gt;$ Trying 10.21.21.11...&lt;BR /&gt;Connected to 10.21.21.11.&lt;BR /&gt;Escape character is '^]'.&lt;BR /&gt;&lt;BR /&gt;***********************************************************&lt;BR /&gt;Unauthorized use of DC Government computing systems may&lt;BR /&gt;involve not only transgression of DC Government policy,&lt;BR /&gt;but also a violation of state and federal laws.&lt;BR /&gt;&lt;BR /&gt;Unauthorized use is a crime and may involve criminal and&lt;BR /&gt;civil penalties.  Violators will be prosecuted to the full&lt;BR /&gt;extent of the law.&lt;BR /&gt;&lt;BR /&gt;Keyboard inputs are monitored in the event of a real or&lt;BR /&gt;perceived security incident. Logon constitutes agreement&lt;BR /&gt;to monitoring of activities.&lt;BR /&gt;************************************************************&lt;BR /&gt;&lt;BR /&gt;User Access Verification&lt;BR /&gt;&lt;BR /&gt;Username: ciscoworks&lt;BR /&gt;Password: invalid command name "Welcome"&lt;BR /&gt;    while executing&lt;BR /&gt;""Welcome" {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;set p 0&lt;BR /&gt;close&lt;BR /&gt;}"&lt;BR /&gt;    ("while" body line 10)&lt;BR /&gt;    invoked from within&lt;BR /&gt;"while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "..."&lt;BR /&gt;    (file "/export/home/rjohnson/expectstuff/getnodeinfo" line 6)&lt;BR /&gt;spawn /bin/sh&lt;BR /&gt;telnet 10.21.253.11&lt;BR /&gt;$ Trying 10.21.253.11...&lt;BR /&gt;Connected to 10.21.253.11.&lt;BR /&gt;Escape character is '^]'.&lt;BR /&gt;&lt;BR /&gt;***********************************************************&lt;BR /&gt;Unauthorized use of DC Government computing systems may&lt;BR /&gt;involve not only transgression of DC Government policy,&lt;BR /&gt;but also a violation of state and federal laws.&lt;BR /&gt;&lt;BR /&gt;Unauthorized use is a crime and may involve criminal and&lt;BR /&gt;civil penalties.  Violators will be prosecuted to the full&lt;BR /&gt;extent of the law.&lt;BR /&gt;&lt;BR /&gt;Keyboard inputs are monitored in the event of a real or&lt;BR /&gt;perceived security incident. Logon constitutes agreement&lt;BR /&gt;to monitoring of activities.&lt;BR /&gt;************************************************************&lt;BR /&gt;&lt;BR /&gt;User Access Verification&lt;BR /&gt;&lt;BR /&gt;Username: ciscoworks&lt;BR /&gt;Password: invalid command name "Welcome"&lt;BR /&gt;    while executing&lt;BR /&gt;""Welcome" {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;set p 0&lt;BR /&gt;close&lt;BR /&gt;}"&lt;BR /&gt;    ("while" body line 10)&lt;BR /&gt;    invoked from within&lt;BR /&gt;"while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "..."&lt;BR /&gt;    (file "/export/home/rjohnson/expectstuff/getnodeinfo" line 6)&lt;BR /&gt;$&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Feb 2005 13:16:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883928#M704348</guid>
      <dc:creator>Rob Johnson_3</dc:creator>
      <dc:date>2005-02-03T13:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: I need help making this work... getnodeinfo: syntax err</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883929#M704349</link>
      <description>just like for n, you'll need to set HOSTNAME before you use it.&lt;BR /&gt;&lt;BR /&gt;"while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;&lt;BR /&gt;you'll need to do this before the while loop.&lt;BR /&gt;&lt;BR /&gt;if you do as has been suggested:&lt;BR /&gt;&lt;BR /&gt;set HOSTNAME [lindex $argv 0]&lt;BR /&gt;&lt;BR /&gt;this will set HOSTNAME to the first value passed on the command line, i.e. whatever $device has been set to (10.21.21.13, etc.)</description>
      <pubDate>Thu, 03 Feb 2005 13:19:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883929#M704349</guid>
      <dc:creator>c_51</dc:creator>
      <dc:date>2005-02-03T13:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: I need help making this work... getnodeinfo: syntax err</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883930#M704350</link>
      <description>I'm sorry, my last response wasn't put in very well.&lt;BR /&gt;&lt;BR /&gt;Here's what I'm getting when I run the dolist script.&lt;BR /&gt;&lt;BR /&gt;********************************************&lt;BR /&gt;$ ./dolist&lt;BR /&gt;spawn /bin/sh&lt;BR /&gt;telnet 10.21.21.13&lt;BR /&gt;$ Trying 10.21.21.13...&lt;BR /&gt;Connected to 10.21.21.13.&lt;BR /&gt;Escape character is '^]'.&lt;BR /&gt;&lt;BR /&gt;***********************************************************&lt;BR /&gt;Unauthorized use of DC Government computing systems may&lt;BR /&gt;involve not only transgression of DC Government policy,&lt;BR /&gt;but also a violation of state and federal laws.&lt;BR /&gt;&lt;BR /&gt;Unauthorized use is a crime and may involve criminal and&lt;BR /&gt;civil penalties.  Violators will be prosecuted to the full&lt;BR /&gt;extent of the law.&lt;BR /&gt;&lt;BR /&gt;Keyboard inputs are monitored in the event of a real or&lt;BR /&gt;perceived security incident. Logon constitutes agreement&lt;BR /&gt;to monitoring of activities.&lt;BR /&gt;************************************************************&lt;BR /&gt;&lt;BR /&gt;User Access Verification&lt;BR /&gt;&lt;BR /&gt;Username: ciscoworks&lt;BR /&gt;Password: invalid command name "Welcome"&lt;BR /&gt;    while executing&lt;BR /&gt;""Welcome" {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;set p 0&lt;BR /&gt;close&lt;BR /&gt;}"&lt;BR /&gt;    ("while" body line 10)&lt;BR /&gt;    invoked from within&lt;BR /&gt;"while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "..."&lt;BR /&gt;    (file "/export/home/rjohnson/expectstuff/getnodeinfo" line 6)&lt;BR /&gt;spawn /bin/sh&lt;BR /&gt;$ telnet 10.21.21.11&lt;BR /&gt;Trying 10.21.21.11...&lt;BR /&gt;Connected to 10.21.21.11.&lt;BR /&gt;Escape character is '^]'.&lt;BR /&gt;&lt;BR /&gt;***********************************************************&lt;BR /&gt;Unauthorized use of DC Government computing systems may&lt;BR /&gt;involve not only transgression of DC Government policy,&lt;BR /&gt;but also a violation of state and federal laws.&lt;BR /&gt;&lt;BR /&gt;Unauthorized use is a crime and may involve criminal and&lt;BR /&gt;civil penalties.  Violators will be prosecuted to the full&lt;BR /&gt;extent of the law.&lt;BR /&gt;&lt;BR /&gt;Keyboard inputs are monitored in the event of a real or&lt;BR /&gt;perceived security incident. Logon constitutes agreement&lt;BR /&gt;to monitoring of activities.&lt;BR /&gt;************************************************************&lt;BR /&gt;&lt;BR /&gt;User Access Verification&lt;BR /&gt;&lt;BR /&gt;Username: ciscoworks&lt;BR /&gt;Password: invalid command name "Welcome"&lt;BR /&gt;    while executing&lt;BR /&gt;""Welcome" {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;set p 0&lt;BR /&gt;close&lt;BR /&gt;}"&lt;BR /&gt;    ("while" body line 10)&lt;BR /&gt;    invoked from within&lt;BR /&gt;"while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "..."&lt;BR /&gt;    (file "/export/home/rjohnson/expectstuff/getnodeinfo" line 6)&lt;BR /&gt;spawn /bin/sh&lt;BR /&gt;$ telnet 10.21.253.11&lt;BR /&gt;Trying 10.21.253.11...&lt;BR /&gt;Connected to 10.21.253.11.&lt;BR /&gt;Escape character is '^]'.&lt;BR /&gt;&lt;BR /&gt;***********************************************************&lt;BR /&gt;Unauthorized use of DC Government computing systems may&lt;BR /&gt;involve not only transgression of DC Government policy,&lt;BR /&gt;but also a violation of state and federal laws.&lt;BR /&gt;&lt;BR /&gt;Unauthorized use is a crime and may involve criminal and&lt;BR /&gt;civil penalties.  Violators will be prosecuted to the full&lt;BR /&gt;extent of the law.&lt;BR /&gt;&lt;BR /&gt;Keyboard inputs are monitored in the event of a real or&lt;BR /&gt;perceived security incident. Logon constitutes agreement&lt;BR /&gt;to monitoring of activities.&lt;BR /&gt;************************************************************&lt;BR /&gt;&lt;BR /&gt;User Access Verification&lt;BR /&gt;&lt;BR /&gt;Username: ciscoworks&lt;BR /&gt;Password: invalid command name "Welcome"&lt;BR /&gt;    while executing&lt;BR /&gt;""Welcome" {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;set p 0&lt;BR /&gt;close&lt;BR /&gt;}"&lt;BR /&gt;    ("while" body line 10)&lt;BR /&gt;    invoked from within&lt;BR /&gt;"while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "..."&lt;BR /&gt;    (file "/export/home/rjohnson/expectstuff/getnodeinfo" line 6)&lt;BR /&gt;$&lt;BR /&gt;Here's the getnodeinfo script &lt;BR /&gt;&lt;BR /&gt;*********************************************&lt;BR /&gt;$ more getnodeinfo&lt;BR /&gt;#!/opt/sfw/bin/expect&lt;BR /&gt;set username "ciscoworks"&lt;BR /&gt;set password "just4us"&lt;BR /&gt;set HOSTNAME [lindex $argv 0]&lt;BR /&gt;set n 0&lt;BR /&gt;while { $n &amp;lt; 5 } {&lt;BR /&gt;spawn "/bin/sh"&lt;BR /&gt;send "telnet $HOSTNAME\r"&lt;BR /&gt;sleep 1&lt;BR /&gt;expect "Username:"&lt;BR /&gt;send "$username\r"&lt;BR /&gt;expect "Password"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;send "\r\r"&lt;BR /&gt;"Welcome" {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;set p 0&lt;BR /&gt;close&lt;BR /&gt;}&lt;BR /&gt;"from" {&lt;BR /&gt;send "id\r"&lt;BR /&gt;expect {&lt;BR /&gt;$username {&lt;BR /&gt;incr pass0&lt;BR /&gt;set n 5&lt;BR /&gt;close&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;"login: $" {&lt;BR /&gt;set pass1 0&lt;BR /&gt;puts stdout "Expect return: $expect_out(0,string)"&lt;BR /&gt;puts stdout "Failed login"&lt;BR /&gt;send "\x1d\x0d"&lt;BR /&gt;expect "telnet"&lt;BR /&gt;send "close\r"&lt;BR /&gt;send "quit\r"&lt;BR /&gt;close&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;incr n&lt;BR /&gt;}&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Feb 2005 13:32:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883930#M704350</guid>
      <dc:creator>Rob Johnson_3</dc:creator>
      <dc:date>2005-02-03T13:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: I need help making this work... getnodeinfo: syntax err</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883931#M704351</link>
      <description>instead of: expect "Password"&lt;BR /&gt;&lt;BR /&gt;use: expect "Password*"&lt;BR /&gt;&lt;BR /&gt;then, after send "\r\r"&lt;BR /&gt;&lt;BR /&gt;expect "Welcome" {&lt;BR /&gt;&lt;BR /&gt;and then make sure your braces are matching up, {}'s</description>
      <pubDate>Thu, 03 Feb 2005 13:50:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883931#M704351</guid>
      <dc:creator>c_51</dc:creator>
      <dc:date>2005-02-03T13:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: I need help making this work... getnodeinfo: syntax err</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883932#M704352</link>
      <description>That did it!!!&lt;BR /&gt;&lt;BR /&gt;Thanks so much for the help.  I so much wish I was programmed to be a programmer.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Feb 2005 13:59:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883932#M704352</guid>
      <dc:creator>Rob Johnson_3</dc:creator>
      <dc:date>2005-02-03T13:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: I need help making this work... getnodeinfo: syntax err</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883933#M704353</link>
      <description>I've spent the last three days posting this to a couple of other forums and made it absolutely nowhere.  I posted this only a few hours ago to ITRC and the problem is now solved.  That shows there are truly some experts on this forum.&lt;BR /&gt;Thanks so much.</description>
      <pubDate>Thu, 03 Feb 2005 14:02:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-making-this-work-getnodeinfo-syntax-err/m-p/4883933#M704353</guid>
      <dc:creator>Rob Johnson_3</dc:creator>
      <dc:date>2005-02-03T14:02:35Z</dc:date>
    </item>
  </channel>
</rss>

