?
Solved

Expect script work locally but not when called remotely via SSH

Posted on 2013-05-12
6
Medium Priority
?
422 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 

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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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.
Suggested Courses

764 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