Heather Klish
asked on
Help with spawning a process in an Expect script
I am trying to spawn a process in an expect script and I keep getting an error message that it can't find the file I am trying to spawn. I am trying to login to an ssh client (putty) that lives on my local computer
Here is the the first line of the expect script:
#first start the process
package require Expect
spawn ssh library.tufts.edu
And here is the error message I am getting:
C:\Tcl\bin>tclsh library.tufts.edu.tcl
The system cannot find the file specified.
while executing
"spawn ssh library.tufts.edu"
(file "library.tufts.edu.tcl" line 6)
It seems there is some syntax I am missing to spawn the process
Here is the the first line of the expect script:
#first start the process
package require Expect
spawn ssh library.tufts.edu
And here is the error message I am getting:
C:\Tcl\bin>tclsh library.tufts.edu.tcl
The system cannot find the file specified.
while executing
"spawn ssh library.tufts.edu"
(file "library.tufts.edu.tcl" line 6)
It seems there is some syntax I am missing to spawn the process
try to put the full path to ssh or set your PATH env variable to include the dir ssh is in
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you. I will try installing cygwin.
ASKER
I installed cygwin and included tcl as part of the installation. But I can't seem to find expect within the cygwin directory and it does not recognize the command "expect" from the command prompt. What am I missing?
Thanks in advance
Thanks in advance
try to run find . -name "expect*"
You probably didn't install expect. Run the installer again, and when you get to the screen with all the categories in it, enter expect in the search box at top left hand of screen.
Remember you have to use a bash command prompt, not CMD.EXE
You might also want to install Cygwin's copy of ssh
Remember you have to use a bash command prompt, not CMD.EXE
You might also want to install Cygwin's copy of ssh