09-16-2009
expect_out(buffer) not complete
I have only some info into my buffer, but after a rssi command I see the folowing lines expected into buffer but not present :
[Main Ch0] rssi=-106
[Div Ch0] rssi=-109
I see in my buffer only the first part of the output, here you are a part of script :
#!/usr/bin/expect -f
#global expect_out
match_max 10000000
....
send -- "telnet 192.168.131.001"
sleep 10s
send -- "\r"
expect "ANDWCSHY0039>"
send -- "rssi\r"
sleep 10s
#send "\n"
set val $expect_out(buffer)
sleep 10s
puts "OUTPUT IS \n"
puts "A$val A"
Perhaps [ is one special chr in expect/tcl scripts.
Please Do you have any idea about my issue ?
Thanks
Bye
Ugo
Last edited by ugobale; 09-16-2009 at 02:02 PM..
Reason: updated with more info
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
this question is probably trivial to most of you but i do not have the answer.
the task is simple...
yank 7 lines of text from one file and paste them to another
so while in command mode i enter
"b7yy and i get 7 lines yanked
exit vi with :q!
open the new file
while in command mode i... (2 Replies)
Discussion started by: cookiebooy
2 Replies
2. Shell Programming and Scripting
This is my simple expect scritpt:
#!/usr/bin/expect -f
match_max 100000
set timeout -1
spawn telnet $IP
expect "#"
send -- "shell\r"
expect "*Ready*"
send -- "init\r"
expect "*Ready*"
send -- "readsensor \r"
expect -- "*" <<< Output of this is a 2 digit number
set val... (5 Replies)
Discussion started by: expect_user
5 Replies
3. Shell Programming and Scripting
Hello everyone!
This is the situation:
I execute this command from a bash script:
telnet 10.99.246.14 6001 >> output.txt
The question is:
How I do to execute this command and empty the buffer when is full?
The script is always running.
Thanks a lot! (2 Replies)
Discussion started by: bobbasystem
2 Replies
4. Shell Programming and Scripting
I am trying to use send and receive using expect. the expect_out(buffer) is working fine while it is running it as foreground. But the same script when it is ran as background, the expect_out(buffer) errored out.
Is there any factor influence when we run script in foreground and in background? ... (0 Replies)
Discussion started by: shellscripter
0 Replies
5. Programming
Greetings,
Having an issue with the expect_out(buffer). in a foreach loop through some switches I am grabbing some arp table information and writing it out to output files (1 each for each switch looped through).
The first iteration works fine. the second iteration of the loop writes the... (0 Replies)
Discussion started by: SuperSix4
0 Replies
6. Shell Programming and Scripting
Hello "expect" experts
I am new at Expect. I have searched for a little while how to capture multiple lines with Expect and I am almost succeeded on that but I don't get all the lines of a command's output that the script executes on a server.
Here is how my script works in a nutshell -
... (6 Replies)
Discussion started by: capacho6666
6 Replies
7. Shell Programming and Scripting
I am trying to read a file via SSH connect and store it to expect_out(buffer). I am a virgin to expect. Help is really appreciated. Wasted almost a day :-(
Code is as follows
expect "system32>"
send "type output.csv";
send "\r";
expect "system32>"
set outcome $expect_out(buffer)... (2 Replies)
Discussion started by: cityprince143
2 Replies
8. Programming
Can some one tell me how to flush expect_out(buffer)?
below is my code
expect -re {.*} {}
expect "swpackages>*"
send -i $con "trial.bat \r"
set outcome $expect_out(buffer)
expect "*continue*"
set prevreport $expect_out(buffer)
send "\r \r";
problem is :- I am getting "pre" stuffs... (0 Replies)
Discussion started by: cityprince143
0 Replies
9. Shell Programming and Scripting
I have a code like this :
set ipv6_acl_max_chars test_acl_max_chars123456a789%s%d2345678ww134rt789qa23456789012345%c89012%a56789012x4r67890test_acl_max_chars1234567890.01234aabcdob34567aBC0
spawn telnet $myip
expect "Login:" { send "admin\r" }
expect "Password:" {send "admin\r" }... (0 Replies)
Discussion started by: ylucki
0 Replies
10. Shell Programming and Scripting
trying to telnet to a device, list the files, and delete them. I can get the script to telnet and log in OK, and even issue the command to list out the files. I can't figure out how to parse the expect_out(buffer) and extract the file name for use in the delete command.
the files list out like... (4 Replies)
Discussion started by: imatinkerer
4 Replies
LEARN ABOUT PHP
ob_end_flush
OB_END_FLUSH(3) 1 OB_END_FLUSH(3)
ob_end_flush - Flush (send) the output buffer and turn off output buffering
SYNOPSIS
bool ob_end_flush (void )
DESCRIPTION
This function will send the contents of the topmost output buffer (if any) and turn this output buffer off. If you want to further process
the buffer's contents you have to call ob_get_contents(3) before ob_end_flush(3) as the buffer contents are discarded after ob_end_flush(3)
is called.
The output buffer must be started by ob_start(3) with PHP_OUTPUT_HANDLER_FLUSHABLE and PHP_OUTPUT_HANDLER_REMOVABLE flags. Otherwise
ob_end_flush(3) will not work.
Note
This function is similar to ob_get_flush(3), except that ob_get_flush(3) returns the buffer as a string.
RETURN VALUES
Returns TRUE on success or FALSE on failure. Reasons for failure are first that you called the function without an active buffer or that
for some reason a buffer could not be deleted (possible for special buffer).
ERRORS
/EXCEPTIONS
If the function fails it generates an E_NOTICE.
EXAMPLES
Example #1
ob_end_flush(3) example
The following example shows an easy way to flush and end all output buffers:
<?php
while (@ob_end_flush());
?>
SEE ALSO
ob_start(3), ob_get_contents(3), ob_get_flush(3), ob_flush(3), ob_end_clean(3).
PHP Documentation Group OB_END_FLUSH(3)