problem in expect
HI, I have problem in ssh, im trying to connect to another server through expect program, and after conecting, ill change into a particular directory to check if a lock file exist.
Below i did a if statement to check if the file exist or not, but it not working, how to solve this problem. pls advice. thanks Quote:
|
This is a very convoluted way to check for a file on a remote system. A simpler method which doesn't require expect at all if something like this:
Code:
#!/bin/ksh If you insist on using expect, I don't know why you spawn a ksh and then sending the ssh command to it - why not just spawn the ssh command? Also, why are you expecting the command "ls -la /projects/ilinterf/john/kul_john"? This is not normal. The argument to expect is text you expect to see, not a command. You would typically expect a prompt or some other output which is produced during the login process, which is used as a trigger for sending some other command (in your case some test to see if a file exists). |
All times are GMT -5. The time now is 03:11 AM. |