Have an expect script but can't seem to de-bug it. It's stalling at the password prompt. If anyone can see a mistake, kindly let me know. Thanks.
Here is the error:
Here is my expect script:
I am rather new to using expect and have only written a few scripts using it. I am trying to create a script that will read a file containing a number of hostnames and then for each one: ssh into the box, run a command, scp the output back to a center server.
So far I can make all that... (2 Replies)
I am trying to write a script that telnets out to multiple ip's, runs some commands exits and the telnets to the next ip. I wrote the following script and it works great until the program hits a nonresponsive ip.
I would like this to recognize the ip is bad and move on in the foreach loop. How... (4 Replies)
I am using Expect to spawn a command that loops through a text file and runs the same command for each item in the text file.
The text file, named stat.txt looks something like this:
2007-04 alist 543
2008-07 blist 543
2008-03 xlist 345
2008-03 ylist 675
2003-03 zlist 567
The expect... (1 Reply)
Hi all,
I have got a small expect script like this one.
#!/usr/bin/expect -f
set timeout 2
spawn ftp $env(IP)
match_max 100000
expect -exact "Name"
send -- "$env(USER)\n"
expect -exact "Password:"
send -- "$env(PASSWORD)\n"
expect "%"
send "bin\r"
expect "%"
send "prompt\r"... (5 Replies)
Hi experts,
I have two question about expect script
questions 1
send "tar -xjvf a.tar\r"
send "ifconfig\r"
I want to know if it just run "ifconfig after "tar -xjvf a.tar complete. or the two cmd run at the same time
question 2
after I use the expect to ssh to the... (1 Reply)
I'm having some difficulty with convincing Expect to do what I need..
I have a loop that waits for input, a specific phrase of text followed by a single word. I need Expect to capture that word following the specific phrase. It should then store the word in a variable.
I'm fairly sure it's... (6 Replies)
Hi.,
I need to ask question for expect script.
I have prompt like #
and very long script (orachk).
I added to expect script line
set prompt "(%|#|\\\$) $"
and insert into it also piece of code
----
expect {
timeout {
puts "Running..."
exp_continue
}
... (0 Replies)
I have an expect script that appears to be working normally however for some reason, the remote side appears to be stripping off the variables from the awk command.
This is the original:
expect \"~]$\"
send \"sed 's/=/ /g;s/,/ /g' /home/file.txt | grep abc | awk '{print $6,$8}'This is the... (5 Replies)
I'm using expect to log into a remote host and then execute another script. A log of the script is being created but I can't see to get the script to display while it's running. Any ideas would be appreciated. Here is the script.
#!/bin/bash
cd /root
cat /root/hostname1.txt | while read... (1 Reply)
Discussion started by: jimmyf
1 Replies
LEARN ABOUT SUNOS
spawn
spawn.h(3HEAD) Headers spawn.h(3HEAD)NAME
spawn.h, spawn - spawn
SYNOPSIS
#include <spawn.h>
DESCRIPTION
The <spawn.h> header defines the posix_spawnattr_t and posix_spawn_file_actions_t types used in performing spawn operations.
The <spawn.h> header defines the flags that can be set in a posix_spawnattr_t object using the posix_spawnattr_setflags() function:
POSIX_SPAWN_RESETIDS
POSIX_SPAWN_SETPGROUP
POSIX_SPAWN_SETSCHEDPARAM
POSIX_SPAWN_SETSCHEDULER
POSIX_SPAWN_SETSIGDEF
POSIX_SPAWN_SETSIGMASK
Inclusion of the <spawn.h> header can make visible symbols defined in the <sched.h>, <signal.h>, and <sys/types.h> headers.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO sched.h(3HEAD), semaphore.h(3HEAD), signal.h(3HEAD), types.h(3HEAD), attributes(5), standards(5)SunOS 5.10 10 Sep 2004 spawn.h(3HEAD)