Solved

Expect script work locally but not when called remotely via SSH

Posted on 2013-05-12
6
419 Views
Last Modified: 2013-05-12
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.
0
Comment
Question by:CRC64
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39159748
Its saying there is no file or directory called autosave_list
Is there?
0
 

Author Comment

by:CRC64
ID: 39159755
Here there is.  

The script works locally perfectly ...

The error about the file is only when launched remotely
0
 
LVL 58

Expert Comment

by:Gary
ID: 39159757
Confused. Are you trying to run this script on a remote server or trying to run it from a remote server
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:CRC64
ID: 39159767
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
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 39159795
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
 

Author Closing Comment

by:CRC64
ID: 39159919
Yes, that was the problem. Thank you !!!
0

Featured Post

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Utilizing an array to gracefully append to a list of EmailAddresses
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question