Oops! Good call. <div>Thank you. You pointed out my mistake.</div><div><br></div><div><br clear="all">- Saqib<br><br><br>
<br><br><div class="gmail_quote">On Tue, Dec 20, 2011 at 12:31 AM, Nick Dokos <span dir="ltr"><<a href="mailto:nicholas.dokos@hp.com">nicholas.dokos@hp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Saqib Ali <<a href="mailto:saqib.ali.75@gmail.com">saqib.ali.75@gmail.com</a>> wrote:<br>
<br>
><br>
> I want to write a pexpect script that simply cd's into a directory ("~/<br>
> install") and then runs a command from there. It should be so easy.<br>
> But even my cd command is failing. Can't figure out what the problem<br>
> is. The command line prompt is "[my machine name here] % "<br>
><br>
> Here is the code fragment:<br>
><br>
>     print "Spawning Expect"<br>
>     p = pexpect.spawn ('/bin/tcsh',)<br>
><br>
<br>
</div>If you execute /bin/tcsh by hand, do you get a "%" prompt?<br>
<br>
Nick<br>
<div class="im"><br>
>     print "Sending cd command"<br>
>     i = p.expect([pexpect.TIMEOUT, "%",])<br>
>     assert i != 0, "Time-Out.... exiting"<br>
>     p.sendline("cd ~/install")<br>
><br>
> Here is the output:<br>
><br>
> Spawning Expect<br>
> Sending cd command<br>
> Time-Out.... exiting<br>
><br>
><br>
> How could I be screwing something so simple up??<br>
</div>> --<br>
> <a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
><br>
</blockquote></div><br></div>