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
result=$(ssh user@host '[ -a "/a/path/to/a/file" ] && echo yes || echo no')
At this point the variable
result contains yes if the file exists, no if it does not, and will be blank if there was some connection error.
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).