1
vote
1answer
154 views

script to automate scp in network

I have a network full of Linux machines. In this network, I have a user as user1 with the password as password in all the machines. I have the following script to put files in the home directory of ...
3
votes
1answer
214 views

Why is expect's interact command not working?

I am trying to automate gdb with expect. My script will start gdb, do some initialisation, and then pass the control to the user. Expect's interact command seems like the perfect tool for the job. ...
0
votes
1answer
268 views

Counting files on a remote server with ssh and an expect script

Below is my script to take count for files which are present in remote server. But it is not working. Please help me. #!/usr/bin/expect spawn ssh sduser@172.0.0.2 expect "123" send "123" interact ...
2
votes
2answers
2k views

grep output of expect script

I'm trying to run some expect language, and grep/parse the output all in one script. I want to grep the output of and look for "error" (I should note that standard linux commands like awk, sed, grep, ...
1
vote
1answer
997 views

Run expect inside a bash script as another user

I am writing a bash script to install some small software I'm developing. That script is run with sudo (as root), but some of the commands that are executed by the script need (or should be) run with ...
3
votes
4answers
1k views

passing passwords to a script

I want to scp a file to a remote host, and from there, run a command on the file, and exit the remote session. If I write a usual script, call scp and then ssh, I am prompted to enter two passwords. ...