10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I am new to Expect scripting. I have to connect to a remote server and capture the output. Here I need output of " send "list registered\r"" to be stored in a file. but after execution, /tmp/capture.txt is of 0 byte
#!/usr/bin/expect
spawn ssh abc@10.10.10.10 -p 5022
expect... (2 Replies)
Discussion started by: bns928
2 Replies
2. UNIX for Advanced & Expert Users
I am trying to log on to server as a normal user and then sudo to root.
I am using below expect script.
$ cat SC.orig
expect <<EOF # | tee -a $LOGFILE
spawn sshpass -p "mypassword" ssh -l myid nim
expect "$"
send "sudo su - root\n"
expect "Password:"
send "mypassword\n";
sleep 4... (3 Replies)
Discussion started by: sri243
3 Replies
3. Shell Programming and Scripting
Hi,
I am using expect to ssh to a remote host and run a program on the remote machine which has a variable runtime. I need to wait until it finishes so I can grab the output file of this program. I am trying to use the output of grep to know when the process finishes. I am trying to capture... (0 Replies)
Discussion started by: vagabond1964
0 Replies
4. Shell Programming and Scripting
Hi Guys,
Further to my post yesterday I have got round the issue of not being able to use expect by using one of our unix machines to have the script running instead of the jumpbox itself. However my issue is I now have an extra bit it the script which is shh to the jumpbox which requires a ras... (1 Reply)
Discussion started by: mutley2202
1 Replies
5. Shell Programming and Scripting
Hi All,
When starting an SSH tunnel, piped output 'hangs' (on AIX) :
ssh -Nf -Llocalhost:22000:server:22 proxy | cat -vet -
... hangs ...
Does anybody know how to prevent this?
Of course, in my script I don't use the tunnel as I do in the example above. In my script the call to ssh is... (7 Replies)
Discussion started by: whbos
7 Replies
6. Shell Programming and Scripting
Hi!
I want to start OO in headless mode via expect -
the oo command would be
su - root -c "/usr/lib/openoffice/program/soffice -headless -nofirststartwizard -norestore -nolockcheck -nocrashreport -nodefault -accept='socket,host=0.0.0.0,port=8100;urp;StarOffice.Service'"
and the expect... (2 Replies)
Discussion started by: senior.weber
2 Replies
7. Shell Programming and Scripting
Hi
I'm working on an Expect script that is supposed to log-into a remote server and run some steps and exit. In the script I first spawn a 'ssh' session to the server and then after logging in I 'send' all the necessary steps ( with a '\r' at the end, so that they get automatically executed the... (3 Replies)
Discussion started by: clakkad
3 Replies
8. Shell Programming and Scripting
Hi,
I'm trying to come up with a simple expect script that allows me to login to a system and run a single command ... something like this:
#!/usr/bin/expect -f
# let's set some variables
#set password
set ipaddr
set ponumber
set hostname
set timeout -1
# let's now connect to the... (0 Replies)
Discussion started by: danielsf
0 Replies
9. Shell Programming and Scripting
hi
i am having a c code which gives the output of my password in text format
i.e when i run my c code which which gives the password asfollows====>>>>>>
$./passwdprogram ======>>>>>>abc@123(this is the output)
now i have an expect script to remotely ssh which uses the password set in ... (0 Replies)
Discussion started by: xander
0 Replies
10. Shell Programming and Scripting
I'm using expect script, but don't know how to assign an output to a string variable. Any help ?
Thank you for reading!
PS:
In fact i want to get the out put of expect when run grub-md5-crypt to generate MD5 password for GRUB boot loader.
My code:#!/bin/sh
#\
exec expect -f "$0" ${1+"$@"}... (4 Replies)
Discussion started by: fongthai
4 Replies