01-12-2012
Expect
Use expect command
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to write a script which would run from one host say A and connect to other remote host B and then run rest of commands in that host. I tried connecting from A host to B with SSH but after connecting to host B it just getting me inside Host B command prompt. Rest of the script is not running... (6 Replies)
Discussion started by: SN2009
6 Replies
2. UNIX for Advanced & Expert Users
I do a ssh to remote host(A1) from local host(L1). I then ssh to another remote(A2) from A1.
When I do a who -m from A2, I see the "connected from" as "A1".
=> who -m
userid pts/2 2010-03-27 08:47 (A1)
I want to identify who is the local host who initiated the connection to... (3 Replies)
Discussion started by: gomes1333
3 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I wish to run a script located on a remote host machineB from machineA.
I am using ssh and running the below on machineA.
However, the ssh does not seem to work and freezes at
ssh -l wlsadmin machineB -v
Sun_SSH_1.1.2, SSH protocols 1.5/2.0, OpenSSL 0x0090704f
debug1: Reading... (9 Replies)
Discussion started by: shifahim
9 Replies
4. Shell Programming and Scripting
I am newbie in Unix and Expect script, so please help me :(
I'm using expect script for remote another host:
#!/usr/bin/expect -f
set timeout 10
spawn ssh -l root 10.120.18.4
expect "password:"
send "password\r"
expect "@"
interact
And now how can i use expect script for access mysql... (2 Replies)
Discussion started by: wormym
2 Replies
5. Shell Programming and Scripting
HI Unix Gurus,
I an stuck in an interesting issue, where I am trying to execute a script on remote server after ssh.
The script on remote server is interactive,. Whenever it is called it hangs where it expects input from terminal and I have to terminate it.
I have searched through fourm... (12 Replies)
Discussion started by: Jeevanm
12 Replies
6. Shell Programming and Scripting
Hi,
I am new to the expect scripting.
I have this expect script as below :
spawn ssh remote_server -l id
set pass "12345"
set opt "s"
expect "Password:" {send "$pass\r" ; }
expect "*ENTER*" {send "Enter\r"; exp_continue }
expect "Please select option :" {send... (2 Replies)
Discussion started by: curt137
2 Replies
7. Shell Programming and Scripting
Hi,
Given addresses of 2 remote machines, using a shell script is it possible to
get the state of running processes in "src"
stop all the processes in "src"
exit out of "src"
ssh into "dest"
resume the state of executing processes captured in step 1 in "dest"
Assumption:
"src" is... (3 Replies)
Discussion started by: Saeya Darsan
3 Replies
8. Shell Programming and Scripting
Hi friends,
I have two servers. Server A and B.
I want to run one script on server A by logging in to server B.
Can anyone provide me code for this.? I tried it by using following
ssh username@serverA ./script
Then it prompt me the password. I give correct password of the server A. but it... (7 Replies)
Discussion started by: Nakul_sh
7 Replies
9. Shell Programming and Scripting
Geeks,
Could you please help me out in my script and identify the missing piece. I need to check/get the exit status of a remote command executed on remote host through script and send out an email when process/processes is/are not running on any/all server(s).
Here's the complete... (5 Replies)
Discussion started by: lovesaikrishna
5 Replies
10. Shell Programming and Scripting
Hi,
I got most of the script working, last part which does the ssh to remote and execute the command not working.
for SSH in ${HostList}; do
echo ${SSH}
echo ""
SSH2SEND=ssh user@${SSH} curl -v $URL
echo $SSH2SEND
done
error message I am getting ... (5 Replies)
Discussion started by: samnyc
5 Replies
opx25(1M) opx25(1M)
NAME
opx25 - execute HALGOL programs
SYNOPSIS
scriptname] char] file-descriptor] file-descriptor] string]
DESCRIPTION
The commands, including are targeted for removal from HP-UX; see the below.
HALGOL is a simple language for communicating with devices such as modems and X.25 PADs. It has simple statements similar to and that are
described below.
Options
recognizes the following options:
Causes to read script as the input program. If is not specified, reads the standard input as a script.
Causes to use char as the first character in the input stream instead of actually reading it from the input descriptor.
This is useful sometimes when the program that calls is forced to read a character but then cannot ``unread'' it.
Causes to use number for the output file descriptor (i.e., the device to use for The default is 1.
Causes to use 'number' for the input file descriptor (ie, the device to use for 'expect'). The default is 0.
Causes to save this string for use when is encountered in a command.
Causes to turn on debugging mode.
Causes to turn on verbose mode.
An script file contains lines of the following types:
(empty) Empty lines are ignored.
Lines beginning with a slash
are ignored (comments)
ID ID denotes a label, and is limited to alphanumerics or
string must be surrounded by double quotes. The text is sent to the device specified by the option. Non-printable charac-
ters are represented as in C; i.e., as DDD, where DDD is the octal ascii character code. in a send string is the
string that followed the option.
Send a break "character" to the device.
Here number is how many seconds to wait before giving up. 0 means wait forever, but this is not advised. Whenever string
appears in the input within the time allotted, the command succeeds. Thus, it is not necessary to specify the entire
string. For example, if you know that the PAD will send several lines followed by an prompt, you could just use as
the string.
The program etc.) is run with the args specified. Do not use quotes here. Also, the program is invoked directly (using so wild
cards, redirection, etc. are not possible.
If the most recent expect or run encountered an error,
go to the label ID.
Similar to but does not fork.
Similar to but goes to standard error instead of to the device.
Sets the program in debug mode.
It echoes each line to as well as giving the result of each expect and run. This can be useful for writing new
scripts. The command disables this feature.
Sends subsequent incoming characters to
This can be used in the file as a security measure, because part of the incoming data stream contains the number of
the caller. There is a similar feature in it writes the time and the login name into the same logfile. The command
disables this feature.
Similar to but better in some cases because it sends only digits to the log file, and not other characters. The command dis-
ables this feature.
Sets a global timeout value.
Each expect uses time in the timeout reservoir; when this time is gone, the program gives up (exit 1). If this com-
mand is not used, there is no global timeout. Also, the global timeout can be reset any time, and a value of 0 turns
it off.
Exits with this value.
0 is success; anything else is failure.
To perform a rudimentary test of configuration files, run by hand, using the option followed by the name of the script file. then sends to
standard output and expects from standard input; thus you can type the input, observe the output, and use the command to see messages. See
the file for a good example of HALGOL programming.
WARNINGS
Use of commands, including is discouraged because they are targeted for removal from HP-UX. Use ftp(1) or rcp(1) instead.
AUTHOR
was developed by HP.
SEE ALSO
getx25(1), uucp(1).
TO BE OBSOLETED opx25(1M)