Expect script work locally but not when called remotely via SSH

My expect script expect-script.txt.txt  runs fine when launched locally, but when I launch it from a remote server I get errors suggesting that the paths of the files are invalid. expect-error.txt.

I am clueless as what needs to be added to make this work ...

Thanks in advance for your help.
CRC64Asked:
Who is Participating?
 
woolmilkporcConnect With a Mentor Commented:
Specify the full path to autosave_list.

Seems that this file is not in the HOME directory of "username" which is set by ssh as the "current" directory.

This hasn't anything  to do with the PATH variable nor with the directory where the expect script itself is located.
0
 
GaryCommented:
Its saying there is no file or directory called autosave_list
Is there?
0
 
CRC64Author Commented:
Here there is.  

The script works locally perfectly ...

The error about the file is only when launched remotely
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
GaryCommented:
Confused. Are you trying to run this script on a remote server or trying to run it from a remote server
0
 
CRC64Author Commented:
Sorry. The script is on server A and I am try to run it FROM server B.

 While on server B I am doing:  ssh username@serverA <full_path_of_expect_file>

The script works correctly when run on server A
0
 
CRC64Author Commented:
Yes, that was the problem. Thank you !!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.