question about "sleep" command in expect script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting question about "sleep" command in expect script
# 1  
Old 06-01-2009
Java question about "sleep" command in expect script

I wrote some expect script to telnet to some device to execute some commands.Firstly,I can't get full result some time,then I try to add some "sleep" command in it.Fortunately it works.
My idea about it is that it uses sleep command to wait the result to be displayed.Am I right or correct the answer.

Thanks!
# 2  
Old 06-01-2009
'sleep' simply tells the expect process to wait a bit! This can be useful if, for example, you've detected that you've connected but the receiving device is not really ready for the next sent input. A 'sleep' gives the process breathing space. You may also find it useful to slow down the rate at which characters are sent with the variable send_slow.
# 3  
Old 06-01-2009
You can find the details in the man page

man sleep
# 4  
Old 06-01-2009
Expect has its own built in sleep command that accepts fractions of seconds unlike the Unix sleep command referred to in the man page
# 5  
Old 06-01-2009
Java

use wait
man wait

wait -await process completion
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

Expect: spawn id exp5 not open while executing "expect "$" { send "sudo su -\r" }"

Hi All, i am trying to ssh to a remote machine and execute certain command to remote machine through script. i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as expect: spawn id exp5 not open while executing "expect "$" {... (3 Replies)
Discussion started by: Siddharth shivh
3 Replies

3. Shell Programming and Scripting

Can someone please show me a very simple "expect" script to change password in Solaris please?

Ladies & Gents, Can one of you gurus please show me a very simple "expect" script to change the password in Solaris in a script, please? Nothing fancy, no error checking, no nothing. Just to change the password of a new user, it's all. Many thanks in advance. U guys have honestly earned my... (1 Reply)
Discussion started by: Hiroshi
1 Replies

4. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

5. Shell Programming and Scripting

Expect Script - Variables are Empty immediately after "Setting" Them?

Hello All, I have embedded some expect code inside a Bash script I'm writing, but for some reason any variable I 'set' to something is showing as empty immediately on the next line... I haven't run into this problem before so I'm not sure what it could be...? I'm guessing it has something to... (4 Replies)
Discussion started by: mrm5102
4 Replies

6. 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

7. Shell Programming and Scripting

Expect Scripting - Using the "interact" command?

Hello All, I am writing an Expect Script to execute some commands over ssh then exit the script. The script works just fine if I automate everything and assuming the correct password was entered. So this Expect Script gets executed from a Bash script... From the Bash script I pass along an... (0 Replies)
Discussion started by: mrm5102
0 Replies

8. Shell Programming and Scripting

exec perl in expect script yields "invalid command"

I'm trying to execute something like this: exec perl -i -pe 's/\015/\012/g' '${file}' in my expect script and I get: error "invalid command name \"perl\". however, if I run perl -i -pe 's/\015/\012/g' "/Users/Shared/menu-items.txt" directly in my terminal, it runs fine. I'm an... (4 Replies)
Discussion started by: dpouliot
4 Replies

9. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

10. Shell Programming and Scripting

Need Help on "Expect" command in shell programming

Hi, Iam using Solaris 10 OS in the server.iam unable to find expect command in bin directory.how can i install the script in the server to use "expect" in shell programming. (1 Reply)
Discussion started by: sudhakaryadav
1 Replies
Login or Register to Ask a Question