<?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 Expect Scripting Procedures in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/expect-scripting-procedures/m-p/3585515#M18758</link>
    <description>Hi Expect Expert's ,&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;I have furnished a expect code below , I need the below code to be written using a procedure.&lt;BR /&gt;for instance: create/delete role statements are  repeating in more than place, so we can coin it under a single procedure, likewise.&lt;BR /&gt;&lt;BR /&gt;since I am naive user of expect, I am facing difficulties using regular expressions to be used along with expect statement too, so only my expect statements look pretty lengthy, plz do help me in that also and in writing procedure.&lt;BR /&gt;&lt;BR /&gt;please do help me in making the below code procedurised and code length reduced!&lt;BR /&gt;&lt;BR /&gt;Thanks a lot ppl,&lt;BR /&gt;Partha&lt;BR /&gt;&lt;BR /&gt;set timeout 10&lt;BR /&gt;spawn ssh -l abtest 198.16.23.56&lt;BR /&gt;match_max 100000&lt;BR /&gt;expect -exact "abtest@198.16.23.56's password:"&lt;BR /&gt;send -- "ab123\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;iq2-mgmt:/opt/WINWhdtst&amp;gt; "&lt;BR /&gt;send -- "../win/m1gc/bin/m1sh"&lt;BR /&gt;expect -exact "../win/m1gc/bin/m1sh"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r\r&lt;BR /&gt;Copyright (c) 2005 Win  Profsystems, Inc. All rights reserved\r&lt;BR /&gt;Use is subject to license terms.\r&lt;BR /&gt;\r&lt;BR /&gt;N1-ok&amp;gt; "&lt;BR /&gt;send -- "create role testt"&lt;BR /&gt;expect -exact "create role testt"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;N1-ok&amp;gt; "&lt;BR /&gt;send -- "create role testt"&lt;BR /&gt;expect -exact "create role testt"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;\"testt\" already exists.\r&lt;BR /&gt;N1-ok&amp;gt; "&lt;BR /&gt;send -- "delete role testt"&lt;BR /&gt;expect -exact "delete role testt"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;N1-ok&amp;gt; "&lt;BR /&gt;send -- "create role testt"&lt;BR /&gt;expect -exact "create role testt"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;N1-ok&amp;gt; "&lt;BR /&gt;send -- "delete role testt"&lt;BR /&gt;expect -exact "delete role testt"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;N1-ok&amp;gt; "&lt;BR /&gt;send -- "exit"&lt;BR /&gt;expect -exact "exit"&lt;BR /&gt;&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r"&lt;BR /&gt;send -- "exit"&lt;BR /&gt;expect -exact "exit"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r"&lt;BR /&gt;expect eof&lt;BR /&gt;</description>
    <pubDate>Tue, 19 Jul 2005 04:13:00 GMT</pubDate>
    <dc:creator>Partha_7</dc:creator>
    <dc:date>2005-07-19T04:13:00Z</dc:date>
    <item>
      <title>Expect Scripting Procedures</title>
      <link>https://community.hpe.com/t5/operating-system-linux/expect-scripting-procedures/m-p/3585515#M18758</link>
      <description>Hi Expect Expert's ,&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;I have furnished a expect code below , I need the below code to be written using a procedure.&lt;BR /&gt;for instance: create/delete role statements are  repeating in more than place, so we can coin it under a single procedure, likewise.&lt;BR /&gt;&lt;BR /&gt;since I am naive user of expect, I am facing difficulties using regular expressions to be used along with expect statement too, so only my expect statements look pretty lengthy, plz do help me in that also and in writing procedure.&lt;BR /&gt;&lt;BR /&gt;please do help me in making the below code procedurised and code length reduced!&lt;BR /&gt;&lt;BR /&gt;Thanks a lot ppl,&lt;BR /&gt;Partha&lt;BR /&gt;&lt;BR /&gt;set timeout 10&lt;BR /&gt;spawn ssh -l abtest 198.16.23.56&lt;BR /&gt;match_max 100000&lt;BR /&gt;expect -exact "abtest@198.16.23.56's password:"&lt;BR /&gt;send -- "ab123\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;iq2-mgmt:/opt/WINWhdtst&amp;gt; "&lt;BR /&gt;send -- "../win/m1gc/bin/m1sh"&lt;BR /&gt;expect -exact "../win/m1gc/bin/m1sh"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r\r&lt;BR /&gt;Copyright (c) 2005 Win  Profsystems, Inc. All rights reserved\r&lt;BR /&gt;Use is subject to license terms.\r&lt;BR /&gt;\r&lt;BR /&gt;N1-ok&amp;gt; "&lt;BR /&gt;send -- "create role testt"&lt;BR /&gt;expect -exact "create role testt"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;N1-ok&amp;gt; "&lt;BR /&gt;send -- "create role testt"&lt;BR /&gt;expect -exact "create role testt"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;\"testt\" already exists.\r&lt;BR /&gt;N1-ok&amp;gt; "&lt;BR /&gt;send -- "delete role testt"&lt;BR /&gt;expect -exact "delete role testt"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;N1-ok&amp;gt; "&lt;BR /&gt;send -- "create role testt"&lt;BR /&gt;expect -exact "create role testt"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;N1-ok&amp;gt; "&lt;BR /&gt;send -- "delete role testt"&lt;BR /&gt;expect -exact "delete role testt"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;N1-ok&amp;gt; "&lt;BR /&gt;send -- "exit"&lt;BR /&gt;expect -exact "exit"&lt;BR /&gt;&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r"&lt;BR /&gt;send -- "exit"&lt;BR /&gt;expect -exact "exit"&lt;BR /&gt;send -- "\r"&lt;BR /&gt;expect -exact "\r"&lt;BR /&gt;expect eof&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Jul 2005 04:13:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/expect-scripting-procedures/m-p/3585515#M18758</guid>
      <dc:creator>Partha_7</dc:creator>
      <dc:date>2005-07-19T04:13:00Z</dc:date>
    </item>
  </channel>
</rss>

