10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
i am trying to ssh to a remote machine and execute certain command to remote machine through script.
i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as
expect: spawn id exp5 not open
while executing
"expect "$" {... (3 Replies)
Discussion started by: Siddharth shivh
3 Replies
2. Shell Programming and Scripting
Hi,
I am executing a expect script in while loop for doing telnet on list of servers stored in file as below :
expect script :
#!/usr/bin/expect -f
set timeout 20
set ip
set port
if { == 0} {
send_user "Usage: scriptname ip port\n"
exit 1
}
#exp_internal 1
log_user 0
spawn... (3 Replies)
Discussion started by: omkar.jadhav
3 Replies
3. Shell Programming and Scripting
Code Broken!!
"cod generator ip=$loja"
expect -c "
# set timeout -1
set timeout 18
spawn scp -C /etc/samba/arkivo.sh root@$loja:/etc/samba/
expect { -re "*yes/no*"{ send "yes\r"
exp_continue }
-re "*password:*" {
send "senha\r"
expect \"*#*\"}}
ssh root@$loja
expect \"*password:*\"... (4 Replies)
Discussion started by: hrenechen
4 Replies
4. Shell Programming and Scripting
#!/bin/sh
#
#
set -x
stty -echo;
read -p "Input password:" A;
stty echo;
echo;
for HOST in `cat elc.hosts.list`
do
#
echo "Connecting to $HOST"
expect -c "set timeout -1;\
spawn sshr $HOST -l root \"mkdir /perfstat;\";\
match_max 100000;\
expect *'/root/.ssh/id_dsa':*;\
send --... (1 Reply)
Discussion started by: madlot
1 Replies
5. Shell Programming and Scripting
Hi all,
I have a script that runs sftp with expect so I can login and send a file in a cronjob. I've installed this on a couple other servers and it has been fine. However, this time on this machine, it seems to be giving me an issue. It won't move past the spawn sftp command and return a... (3 Replies)
Discussion started by: ltyrrell
3 Replies
6. Shell Programming and Scripting
Good Day Everyone,
I was hoping to get a little insight into an expect script that I've written.
Basically we have this expect script to perform an sftp upload, key authentication is not an option, and sftp is the only method supported by our vendor, thus the need for this.
I want to be... (3 Replies)
Discussion started by: thaller
3 Replies
7. Shell Programming and Scripting
I'm trying to execute something like this:
exec perl -i -pe 's/\015/\012/g' '${file}'
in my expect script and I get:
error "invalid command name \"perl\".
however, if I run
perl -i -pe 's/\015/\012/g' "/Users/Shared/menu-items.txt"
directly in my terminal, it runs fine. I'm an... (4 Replies)
Discussion started by: dpouliot
4 Replies
8. Shell Programming and Scripting
Can 'spawn' script be used more than once in a given expect script ??
What I'm trying to do is, first log-into a remote server through one 'ssh' spawn com and then from there log-into another server using a secod 'ssh' spawn command. But this approach is not working... the second ssh attempt... (1 Reply)
Discussion started by: clakkad
1 Replies
9. Shell Programming and Scripting
Hi All,
I have to write one expect script to login to one system.
I am using
set timeout -1
match_max 100000
spawn ssh root@hostname
Now when I do spawn ssh to that host it send some warning message and one challenge
Challenge: 111-2345
I need to read this challenge value and has... (1 Reply)
Discussion started by: Lokesh Agrawal
1 Replies
10. Shell Programming and Scripting
Hello hello, did a quick search and didn't turn up anything helpful. I've got a book I'm sure has the answers, but I don't think I'll have time to finish it before this all has to work, so here goes~ if this isn't a good place to post and someone could direct me to another forum I'd appreciate... (1 Reply)
Discussion started by: Vryali
1 Replies