<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:osnews="http://osnews.com/rss2#">
	<channel>
		<title>OSNews: </title>
		<link>http://www.osnews.com/story/10929/Command-line_interactive_programs_in_UNIX_shell-scripts</link>
		<description>Exploring the Future of Computing</description>
		<language>en-us</language>
		<copyright>Copyright 2001-2009, David Adams</copyright>
		<webMaster>adam+nospam@osnews.com</webMaster>
		<lastBuildDate>Sat, 05 Dec 2009 01:14:55 GMT</lastBuildDate>
		<image>
			<url>http://www.osnews.com/images/osnews.gif</url>
			<title>OSNews.com</title>
			<link>http://www.osnews.com</link>
		</image>
		<item>
			<title>Good Article</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>Really informative article. I love pieces like this. kudos.</description>
			<pubDate>Tue, 21 Jun 2005 17:59:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Good Article</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>I just brushed through and looked good. Give my inputs later {-:&gt;</description>
			<pubDate>Tue, 21 Jun 2005 18:43:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Expect</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>I didn't read the whole article, but there is autoexpect!</description>
			<pubDate>Tue, 21 Jun 2005 18:51:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>re: Expect</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>Yes, autoexpect is a good tool, but it is used just to automatically create TCL-expect scripts, by watching for user. So it's can be equal to writing expect-scripts by hand. The article just shows several ways to interact with programs using various languages so it doesn't go deep inside TCL or PHP or any additionl tool, like autoexpect.</description>
			<pubDate>Tue, 21 Jun 2005 19:09:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Re: Anand Pandey (IP: 192.151.110.---)</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description><i>I just brushed through and looked good. Give my inputs later {-:&gt; </i><br />
<br />
so why post something now?? no one gives a shit if you have read it.</description>
			<pubDate>Tue, 21 Jun 2005 19:11:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Excellent</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>Apart from some dodgy English ('let's don't' for example), it was a very well written article that helped me understand quite a big problem. One question, isn't it easy for someone to find out a password being used?</description>
			<pubDate>Tue, 21 Jun 2005 19:12:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Intereresting article, my $0.02 in file transfers</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>I run ssh-agent and the box that is to run the unattended script and then, in the script itself:<br />
<br />
#!/bin/sh<br />
<br />
. ~/bin/ssh-command<br />
<br />
scp blah blah user@remotehost:remotedir<br />
or<br />
ssh remotehost command<br />
<br />
I use this to scp my daily backups to an off-site server. Works like a charm. Of course I've only allowed RSA auth since 2002 or so. Passwords I don't trust at all.</description>
			<pubDate>Tue, 21 Jun 2005 19:23:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>wee</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>The return of the assword!@ yay!<br />
<br />
(Yes, I wrote too many modem chat scripts as a kid)</description>
			<pubDate>Tue, 21 Jun 2005 19:25:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Usage</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>Well, expect has helped me a lot, especially when I have to do telnet to Ericsson PBX and get the alarm list, and process it, and put it into DB, and get it via web based app <img src="/images/emo/smile.gif" alt=";)" /></description>
			<pubDate>Tue, 21 Jun 2005 20:12:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Pexpect in Python</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>obviously the author mentioned avoiding perl/sh/python, but just _incase_ you are scripting in python, check out - <a href="http://pexpect.sourceforge.net/" rel="nofollow">http://pexpect.sourceforge.net/</a></description>
			<pubDate>Tue, 21 Jun 2005 20:46:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>++</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>Wow, an informative, interesting and non-inflammatory article on osnews? Whatever is the world coming to...</description>
			<pubDate>Tue, 21 Jun 2005 22:32:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Good article</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>A nice overview of all the option available to solve the problem of automating interactive commands. I agree with the author that a sollution other than perl/python/tcl should be found because most companies just won't let you install all that just for automation.<br />
<br />
So even though I can't use these techniques at work I've bookmarked the article for personal use.</description>
			<pubDate>Tue, 21 Jun 2005 22:42:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>ftprc?</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>Good to hear expect praised, right good stuff and a real buttsaver, but to fully exploit the true power of expect use TCL to manipulate it as an object, take it to the next level. <br />
Discussing automating FTP and leave out the .netrc file?</description>
			<pubDate>Wed, 22 Jun 2005 04:26:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Command-line interactive programs in UNIX shell-scripts</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>Either you're omitting the explanation/solution on purpose, or you still have a lot to learn about shell scripting.<br />
<br />
$ echo luser &amp;&amp; echo TopSecret | telnet foo.bar.com<br />
<br />
Of course this doesn't work - duh. The pipe only applies to the latter of the two echo's. Try this:<br />
<br />
$ (echo luser &amp;&amp; echo TopSecret) | telnet foo.bar.com<br />
<br />
Or:<br />
<br />
$ telnet foo.bar.com</description>
			<pubDate>Wed, 22 Jun 2005 06:18:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: RE: Command-line interactive programs in UNIX shell-scripts</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>I absolutely agree with Anonymous (IP: ---.upc.chello.be).<br />
<br />
The article was nice yeah, I never heard of expect before.<br />
<br />
But the imho easiest solution he oversaw...</description>
			<pubDate>Wed, 22 Jun 2005 07:23:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: RE: Command-line interactive programs in UNIX shell-scripts</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>&gt; $ telnet foo.bar.com luser <br />
&gt;TopSecret <br />
&gt;EOF<br />
<br />
This can't work properly with almost all &quot;telnets&quot;. Why? It was explained in the article.<br />
<br />
&gt; $ echo luser &amp;&amp; echo TopSecret | telnet foo.bar.com <br />
An error in this line has been admitted intentionally because it does not play any role. Because you example: <br />
&gt; $ (echo luser &amp;&amp; echo TopSecret) | telnet foo.bar.co<br />
taken from classical FAQ, can hardly be played on modern telnet servers. See explanation above.<br />
<br />
Heh, You have read through the article not so closely <img src="/images/emo/wink.gif" alt=";)" /></description>
			<pubDate>Wed, 22 Jun 2005 07:42:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Passwords on the command line</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>You do realize that it's a bad thing (tm) to have passwords on the command line, right? They can easily be seen by any other user on the system by doing a simple process list.<br />
<br />
It would be better to read this sensitive information from a file; ie. give 'empty' an option to read the response from a file instead of requiring it to be a command line argument.<br />
<br />
note: having empty read the response from STDIN would also work of course; people can then just do:<br />
  cat pwdfile | empty ...<br />
But that might make people do things like:<br />
  echo &quot;password&quot; | empty ...<br />
which is equally bad of course</description>
			<pubDate>Wed, 22 Jun 2005 11:24:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Passwords on the command line</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>Good idea to hide passwords, I'll think about it.</description>
			<pubDate>Wed, 22 Jun 2005 14:09:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Excellent article</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>Excellent article, interesting and well-written.<br />
<br />
I mostly use kermit for this kind of scripts but I'll try out empty as soon as I get the chance</description>
			<pubDate>Wed, 22 Jun 2005 19:32:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>re: chat</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>I guess 'chat' is a better alternative to your home-grown solution with such an empty meaning of its name.</description>
			<pubDate>Wed, 22 Jun 2005 21:02:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>This is bad &amp;quot;foo&amp;quot;</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>Other than the lessons you can get about using IO redirection and FIFOs, what you are teaching here boils down to bad habits.<br />
<br />
The only time FTP and Telnet should ever be scripted [with the ftp/telnet commands] is when there are absolutely no other options.  In this day an age, there are always other options.  In my opinion (and, yes, I know what an opinion is), a script should never, EVER contain password information.</description>
			<pubDate>Wed, 29 Jun 2005 20:42:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: This is bad &amp;quot;foo&amp;quot;</title>
			<link>http://osnews.com/thread?</link>
			<guid isPermaLink="true">http://osnews.com/thread?</guid>
			<description>Ok, there are always other options <img src="/images/emo/smile.gif" alt=";)" /> <br />
Of course you must not use plain-text passwords and place them directly into scripts. You even must not use telnet protocol at all. And avoid ftp, too. I needn't say why you should use ssh, instead, need I? And you also must not plug your fingers into 220 voltage AC-output.<br />
<br />
Telnet was chosen for examples as less harmless alternative, because it's getting rare in real life, but it can show all basic functions of expect-like tools, even abilities to send passwords.<br />
<br />
BUT, you can use &quot;Expect and Co&quot; to do other things, I just show the direction.</description>
			<pubDate>Thu, 30 Jun 2005 07:18:00 GMT</pubDate>
			<author>donotreply@osnews.com (Anonymous)</author>
			<category>Comments</category>
		</item>
	</channel>
</rss>
