Solved

Expect script work locally but not when called remotely via SSH

Posted on 2013-05-12
6
408 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
  • 3
  • 2
6 Comments
 
LVL 58

Expert Comment

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

Author Comment

by:CRC64
Comment Utility
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
Comment Utility
Confused. Are you trying to run this script on a remote server or trying to run it from a remote server
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:CRC64
Comment Utility
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
Comment Utility
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
Comment Utility
Yes, that was the problem. Thank you !!!
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now