Is there a way to ask expect wait for sometime before running the next send command ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Is there a way to ask expect wait for sometime before running the next send command ?
# 1  
Old 03-04-2009
Is there a way to ask expect wait for sometime before running the next send command ?

Hi all,

After expect catches the string I specify, is there a way to ask expect wait for sometime before running the next send command ?
So my script looks like following,

expect "some string"
#How to ask expect to wait for a while
send "next command"

The reason I want to do this is because after the process I deal with sends out the string I expect it may also send out some other strings which depends on the then situation. So I won't be able to ask to expect catch those strings. Or I don't bother to do that because as long as the "some string" is caught by expect I am happy. I don't care the next texts that spawned process outputs. I just need to wait for them to finish then send my next command.

So how to do that ?

Thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

To send ID and Password for each command using expect feature in bash script

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

Expect command to send the user input enter or ctrl+c

Hey All, I am writing one script using expect, that script which is used in spawn will accepts only 1. Enter 2. Ctrl+c Press Control-C to exit, Enter to proceed. Could some one share some thoughts to send the above user inputs in linux expect block ? Thanks, Sam (0 Replies)
Discussion started by: SCHITIMA
0 Replies

3. Shell Programming and Scripting

How to use expect and send command in UNIX/Linux?

Hello Everyone, I am executing a unix script which logs into 50+ servers (netapp servers) and runs some commands and captures output locally. Below is the code snippet. file1.txt has names of all the remote servers where I am logging in. #!/bin/ksh #!/usr/bin/expect touch... (1 Reply)
Discussion started by: rahul2662
1 Replies

4. Shell Programming and Scripting

problem in automating "fdisk" command using send and expect

hi i want to automate fdisk command . i spawned a process containing fdisk command from a process and tried to send the options to fdisk promt from that process. but that spawed process is notstarting itself help me out trying for two days :wall: my code: #!/bin/bash echo... (5 Replies)
Discussion started by: jagak89
5 Replies

5. Shell Programming and Scripting

Command substitution in send/expect. Please help!

Hi, the following code is not working. How can I cat the last modified file in the path /asdf. Please help! expect "asdf%" {send "cat `ls -rt /asdf|tail -1` \r"} (2 Replies)
Discussion started by: thulasidharan2k
2 Replies

6. Shell Programming and Scripting

expect wait --More-- string and exit

Hi I am programing a expect script on debian, I connected to a firewall to get configuration copy via telnet or ssh but Because of firewall show configuration console wait and print --More-- need press space key at least 100.Help me please. firewall output like this :( This output isn't... (3 Replies)
Discussion started by: ayucelen
3 Replies

7. UNIX for Advanced & Expert Users

how to make a parent wait on a child shells running in background?

Hi I have a shell script A which calls another 10 shell scripts which run in background. How do i make the parent script wait for the child scripts complete, or in other words, i must be able to do a grep of parent script to find out if the child scripts are still running. My Code: ... (1 Reply)
Discussion started by: albertashish
1 Replies

8. Shell Programming and Scripting

wait command - cat it wait for not-chile process?

Did not use 'wait' yet. How I understand by now the wait works only for child processes, started background. Is there any other way to watch completion of any, not related process (at least, a process, owned by the same user?) I need to start a background process, witch will be waiting... (2 Replies)
Discussion started by: alex_5161
2 Replies

9. Shell Programming and Scripting

Use Send command of Expect package

HI All, I am currently working on one command line application on AIX (Unix Platform).Here i need to use Expect package. By using Expect package at the top of the script,i want to use just Send command of Expect package to send characters like, 1. Press Enter key 2. Press spacebar 3.... (6 Replies)
Discussion started by: neha123
6 Replies

10. Shell Programming and Scripting

Expect Send

Dear All, I wanna write a script in which it expect something and if it gets whats expected then send the command relating to that. for instance Userame: Asad Required Password for Asad: ****** I tried to use the expect key word but its does not work. I am using Solaris 8/9 If... (1 Reply)
Discussion started by: asadlone
1 Replies
Login or Register to Ask a Question
SEND-UUCP(8)						      System Manager's Manual						      SEND-UUCP(8)

NAME
send-nntp, send-ihave - send Usenet articles to remote site SYNOPSIS
send-nntp [ -d ] sitename:hostname | sitename [ sitename:hostname | sitename .. ] send-ihave [ -d ] sitename:hostname | sitename [ sitename:hostname | sitename .. ] DESCRIPTION
The send-* utilities are scripts that process the batch files written by innd(8) to send Usenet articles to a remote NNTP site. The sites to be fed may be specified by giving sitename hostname pairs on the command line. The sitename is the label the site has in the newsfeeds file, the hostname is the real hostname of the remote site, a FQDN (Fully Qualified Domain Name). Normally, the sitename and the hostname are the same, and as such don't have to be specified as sitename:hostname pairs but just as a sitename. send-nntp starts an innxmit to send the articles to the remote site. send-ihave encapsulates the articles in an ihave control message and uses inews to send the articles to a to.sitename pseudo-group. Using send-ihave is discouraged, nobody uses it anymore and even the author of this manpage is unsure as to how it actually works or used to work. send-* expect that the batchfile for a site is named <pathoutgoing in inn.conf>/sitename. To prevent batchfile corruption, shlock(1) is used to ``lock'' these files. OPTIONS
-d The ``-d'' flag causes nntpsend to send output to stdout rather than the log file <pathlog in inn.conf>/<program-name>.log. NOTES
You should probably not use send-nntp, but innfeed, or if that is not possible, nntpsend. The usual flags for a batch file for send-nntp are ``Tf,Wfm''. SEE ALSO
newsfeeds(5), nntpsend(8) SEND-UUCP(8)