<?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 How to run multiple commands using expect? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/how-to-run-multiple-commands-using-expect/m-p/5682375#M60035</link>
    <description>&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am in process of creating a script to get multiple commands o/p from some set of servers and collecting its output in a single file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My below commands works fine..&lt;/P&gt;&lt;P&gt;/usr/bin/expect -c "spawn ssh uname@hostname "'head /etc/hosts'" ; expect "'password:'" ; send "usr-passwd" ; interact "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but not this one..&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/usr/bin/expect -c "spawn ssh uname@hostname "'head /etc/hosts&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#800000"&gt;uname -a&lt;/FONT&gt;'" ; expect "'password:'" ; send "usr-passwd" ; interact "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is because expect splits commands due to semicolon added&amp;nbsp;between them. Is there any escape character which can be used here to fix this??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Murugan&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jun 2012 17:02:13 GMT</pubDate>
    <dc:creator>hpmuru</dc:creator>
    <dc:date>2012-06-06T17:02:13Z</dc:date>
    <item>
      <title>How to run multiple commands using expect?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-run-multiple-commands-using-expect/m-p/5682375#M60035</link>
      <description>&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am in process of creating a script to get multiple commands o/p from some set of servers and collecting its output in a single file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My below commands works fine..&lt;/P&gt;&lt;P&gt;/usr/bin/expect -c "spawn ssh uname@hostname "'head /etc/hosts'" ; expect "'password:'" ; send "usr-passwd" ; interact "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but not this one..&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/usr/bin/expect -c "spawn ssh uname@hostname "'head /etc/hosts&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#800000"&gt;uname -a&lt;/FONT&gt;'" ; expect "'password:'" ; send "usr-passwd" ; interact "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is because expect splits commands due to semicolon added&amp;nbsp;between them. Is there any escape character which can be used here to fix this??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Murugan&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2012 17:02:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-run-multiple-commands-using-expect/m-p/5682375#M60035</guid>
      <dc:creator>hpmuru</dc:creator>
      <dc:date>2012-06-06T17:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to run multiple commands using expect?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-run-multiple-commands-using-expect/m-p/5683611#M60036</link>
      <description>&lt;P&gt;&amp;gt;a script to get multiple commands output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any reason you don't create a script that does the multiple commands and then run expect on that script?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2012 15:49:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-run-multiple-commands-using-expect/m-p/5683611#M60036</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-06-07T15:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to run multiple commands using expect?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-run-multiple-commands-using-expect/m-p/5684779#M60037</link>
      <description>&lt;P&gt;Hello &lt;A target="_self" href="https://community.hpe.com/t5/user/viewprofilepage/user-id/22676"&gt;&lt;SPAN class="login-bold"&gt;Dennis Handly&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to get multiple commands output using a single/simple script from different servers. Also, I would like to give the username and password in the same script itself. Password less login using ssh-key or other solutuions doesn't satisfy my requirement.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2012 05:20:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-run-multiple-commands-using-expect/m-p/5684779#M60037</guid>
      <dc:creator>hpmuru</dc:creator>
      <dc:date>2012-06-08T05:20:39Z</dc:date>
    </item>
  </channel>
</rss>

