Multiple expect/send statements not working in shell script
Hi I am trying the following in my bash script which logs into my machine and runs a command. Trying to solve this using expect.
The first expect statement is hit and it enters the address "10.10.0.10" but when the second expect statement is hit it exits
Output: ./test.sh
This doesnt enter the IP again like expected. Any ideas here?
I would like to do this within my bash script and not write a 2nd expect script.Would appreciate any inputs
I added debug to check
Last edited by skorada; 02-12-2018 at 10:11 AM..
Reason: added debug
hi,
how to send multiple files from the shell script
eg : i have
/home/adm/file1
/home/adm/file2
/home/adm/cfg
how can i attach these files in the mail ? (1 Reply)
Hi I have written one shell script , using that i am able to connect to remote machine but i have to
#!/usr/bin/expect -f
set address
set username
set password
set OOLpath
set dbusername
set dbpasswd
set tnsname
set recdbusername
set recdbpasswd
set rectnsname
spawn ssh... (1 Reply)
Hi,
I have written one shell script , using that i am able to connect to remote machine but i have to
#!/usr/bin/expect -f
set address
set username
set password
set OOLpath
set dbusername
set dbpasswd
set tnsname
set recdbusername
set recdbpasswd
set rectnsname
spawn ssh... (2 Replies)
Two things...
1) If I have an if statement that is true I want it to exit without running the rest of the file, but if it is false I want it to continue.. I just did
if ; then
exit
else
echo ""
fi
Can that work? I want it to exit if $1 is 0, and if not to continue running the rest of the... (1 Reply)
Hi,
Am trying to transfer file via FTP using expect script from server to client
i need to interrupt the file transfer between server and client
Please help what should used in expect code..
I used
send "ctrl+c\r"
expect "Aborted"
but that didnt work.. I need what should... (3 Replies)
Shell Scipt: temp.sh
su - <$username>
expect pass.exp
Expect script: pass.exp
#!/usr/bin/expect -f
# Login
#######################
expect "Password: " send "<$password>\r"
it comes up with Password: but doesnt take password passed throguh file. (2 Replies)
I have to send few gzipped files from local server to SFTP server.
My Server Info
Distributor ID: Ubuntu Description: Ubuntu 12.04.4 LTS Release: 12.04 Codename: precise
Created a bash script and could able to send files to sftp, but i want to send email if transfer is successful.
... (1 Reply)
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)
Dear Tech Guys,
I am trying to send some commands on the local server and it always asks for user name and password after each command. To serve the purpose I am using expect function as follows:
#!/usr/bin/expect
set timeout 20
spawn "./data1.sh"
expect "Please Enter UserName: "... (6 Replies)
Discussion started by: Xtreme
6 Replies
LEARN ABOUT NETBSD
xi
XI(4) BSD Kernel Interfaces Manual XI(4)NAME
xi -- Xircom CreditCard Ethernet device driver
SYNOPSIS
xi* at xirc?
Configuration of PHYs may also be necessary. See mii(4).
DESCRIPTION
The xi driver provides support for the Xircom CreditCard family of PCMCIA Ethernet adapters. Supported cards include:
Xircom CreditCard Ethernet II
Xircom CreditCard 10/100 Ethernet
Xircom RealPort 10/100 Ethernet + Modem (Ethernet function only)
Intel EtherExpress Pro/100
Compaq Netelligent 10/100
Cards which should work, but have not been confirmed include:
Xircom RealPort Ethernet
Xircom RealPort 10/100 Ethernet
Some Xircom Ethernet products are supported by the tlp(4) driver.
MEDIA SELECTION
Media selection is done using ifconfig(8) using the standard ifmedia(4) mechanism. Refer to those manual pages for more information.
SEE ALSO ifmedia(4), mii(4), netintro(4), pcmcia(4), tlp(4), xirc(4), ifconfig(8)HISTORY
The xi device driver appeared in NetBSD 1.5.
BUGS
The driver suffers from poor performance. Even with the 10/100 cards, do not expect more than ~450KB/s. Some 10/100 cards may not autonego-
tiate reliably and require manual media selection.
The Xircom multifunction cards which contain both Ethernet and modem interfaces are known to have problems. This is due to the card not
reporting itself correctly as a multifunction card.
BSD June 1, 2007 BSD