<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Automatisation of telnet, ftp or ssh</title>
	<atom:link href="http://www.karkomaonline.com/index.php/2006/06/automatisation-of-telnet-ftp-or-ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.karkomaonline.com/index.php/2006/06/automatisation-of-telnet-ftp-or-ssh/</link>
	<description>a Blog for SysAdmins and Unix stuff in general</description>
	<lastBuildDate>Tue, 13 Sep 2011 05:10:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Pascal</title>
		<link>http://www.karkomaonline.com/index.php/2006/06/automatisation-of-telnet-ftp-or-ssh/comment-page-1/#comment-77</link>
		<dc:creator>Pascal</dc:creator>
		<pubDate>Tue, 12 Dec 2006 09:49:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.karkoma.info/index.php/2006/06/12/automatisation-of-telnet-ftp-or-ssh/#comment-77</guid>
		<description>-- script expect : expectacion.tcl



&lt;blockquote&gt;#!/usr/bin/expect
set timeout 180
set host [lindex $argv 0]
set user root
# user is root here but is can be an other and after send a &quot;su&quot; to do serious things

set password [lindex $argv 1]
set cmd [lindex $argv 2]

# you can spawn ssh ftp, whatelses...
spawn /usr/bin/telnet $host
# keep in mind that the login strings can be other
expect &quot;ogin: &quot;
send &quot;$user\r&quot;
expect &quot;assword: &quot;
send &quot;$password\r&quot;
# of course the prompt can be also other
expect &quot;root# &quot;
send &quot;$cmd\r&quot;
expect &quot;root# &quot;
send &quot;exit\r&quot;
expect eof&lt;/blockquote&gt;



-- end of the script

&lt;p&gt;Pascal.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>&#8211; script expect : expectacion.tcl</p>
<blockquote><p>#!/usr/bin/expect<br />
set timeout 180<br />
set host [lindex $argv 0]<br />
set user root<br />
# user is root here but is can be an other and after send a &#8220;su&#8221; to do serious things</p>
<p>set password [lindex $argv 1]<br />
set cmd [lindex $argv 2]</p>
<p># you can spawn ssh ftp, whatelses&#8230;<br />
spawn /usr/bin/telnet $host<br />
# keep in mind that the login strings can be other<br />
expect &#8220;ogin: &#8221;<br />
send &#8220;$user\r&#8221;<br />
expect &#8220;assword: &#8221;<br />
send &#8220;$password\r&#8221;<br />
# of course the prompt can be also other<br />
expect &#8220;root# &#8221;<br />
send &#8220;$cmd\r&#8221;<br />
expect &#8220;root# &#8221;<br />
send &#8220;exit\r&#8221;<br />
expect eof</p></blockquote>
<p>&#8211; end of the script</p>
<p>Pascal.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

