Can you try creating an empty STDIN file (something like /tmp/stdin.txt) on the system where the expect script is running, and then add the STDIN option to the PROCESS START request:
‘start shell command “/usr/local/expect/expect-5.43/testsuite/expect.tests/expstart.sh” RETURNSTDOUT STDERRTOSTDOUT STDIN /tmp/stdin.txt WAIT’ Thanks, David David Bender STAF/STAX Development IBM Software Group, WPLC 11501 Burnet Rd. Bldg. 903-5B002 Austin, TX 78758-3400 Phone (T/L): 1-512-286-5315 (363-5315) ITN: 23635315 Email: bda...@us.ibm.com "Farhad Sabeti" <fsab...@alarmpoint.com> 10/21/2009 03:26 PM To Paul Ellsworth/San Jose/i...@ibmus cc staf-users@lists.sourceforge.net Subject Re: [staf-users] Can not run expect using STAF automation Thanks Paul, Nikunj and David for your replies, So, I did add more debugging and investigation as you guys suggested and added the export SHELL=/bin/bash and now got expect to run my script. But then it just hangs in there. I will have to put some logging command inside the expect script to see why it is hanging. My guess is that it is not seeing the prompt which I am waiting for. It looks as though the shell that expect script is to perform its operations is not visible to the script. Not sure what is going on. I will have to put some logging stuff inside my expect script to figure out what is happening once expect script is running. (using STAF). Thanks again, Farhad From: Paul Ellsworth [mailto:pell...@us.ibm.com] Sent: Wednesday, October 21, 2009 12:15 PM To: Farhad Sabeti Cc: staf-users@lists.sourceforge.net Subject: Re: [staf-users] Can not run expect using STAF automation Could it be that expect is not in the PATH that the STAF process's environment has defined? I ran into this issue while testing and fixed it by editing the /usr/local/staf/STAFEnv.sh to include my product's binary directory in the PATH. It could be that expect is in the target machine's login profile PATH env var but not in STAF's env var... - Paul Ellsworth "Farhad Sabeti" ---10/21/2009 11:10:40 AM---Hello every body, I just subscribed to this mailing list, not sure if it is working From: "Farhad Sabeti" <fsab...@alarmpoint.com> To: <staf-users@lists.sourceforge.net> Date: 10/21/2009 11:10 AM Subject: [staf-users] Can not run expect using STAF automation Hello every body, I just subscribed to this mailing list, not sure if it is working properly or not. I am using STAF for the automation infrastructure and using expect for more interactive automation. On a Linux server I have written an expect script to automate installation of our product and its working fine. But when I use STAF from a remote machine, it won’t work. Other shell commands work fine (like dir, chmod, ….) but running expect <filename> does not work. Was wondering if anyone knows why. It simply executes the command and nothing happens. I put my expect command in a shell script like this: #!/bin/sh expect /usr/local/expect/expect-5.43/testsuite/expect.tests/apinstfinal.exp /usr/local/expect/expect-5.43/testsuite/expect.tests/installinput.txt and called it expstart.sh and on the target machine when I do ./expstart.sh, it runs it and works just fine. But when I use STAF command: ‘start shell command “/usr/local/expect/expect-5.43/testsuite/expect.tests/expstart.sh” WAIT’ It won’t work. I then created another shell file called dirh.sh and put a simple dir in that shell file and redirected output to some file like t4.out, it works fine, like below: ‘start shell command “/usr/local/expect/expect-5.43/testsuite/expect.tests/dirh.sh >/root/t4.out” WAIT’ But when shell file has expect, it won’t work. (I also put >/root/t3.out ) in shell command for the expect shell scrip to capture the output, and it comes up empty. Any help is appreciated. Regards, Farhad ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users
<<image/gif>>
------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference
_______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users