10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
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
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
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)
Discussion started by: krux_rap
1 Replies
4. Shell Programming and Scripting
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)
Discussion started by: bhavesh.sapra
2 Replies
5. AIX
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)
Discussion started by: Priya Amaresh
3 Replies
6. Shell Programming and Scripting
Hi,
Please share you experience and way out on below error:-->
#!/bin/bash -xv
FILE=login.txt
+ FILE=login.txt
CONNECT=sshlogin.exp
+ CONNECT=sshlogin.exp
SERVERNAME=$1
+ SERVERNAME=192.168.12.1
MyServer=""
+ MyServer=
MyUser=""
+ MyUser=
MyPassword=""
+ MyPassword=
exec 3<&0
+... (6 Replies)
Discussion started by: manish_1678
6 Replies
7. Shell Programming and Scripting
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)
Discussion started by: glev2005
1 Replies
8. Shell Programming and Scripting
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)
Discussion started by: mnmonu
2 Replies
9. Shell Programming and Scripting
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)
Discussion started by: mnmonu
1 Replies
10. Shell Programming and Scripting
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)
Discussion started by: mail2sant
1 Replies