12-10-2013
Thank You :-)
Thank You in2nix4life
I tried
" $expect_out(1,string)" and " $expect_out(0,string)"
but didn't return what I expected.
instead I use "$expect_out(buffer)" with "match_max 10000" which return me what I was expecting.
Just wondering is it because the output i am trying to capture is too long which make " $expect_out(0,string)" fail?
10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
I have only some info into my buffer, but after a rssi command I see the folowing lines expected into buffer but not present :
rssi=-106
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... (1 Reply)
Discussion started by: ugobale
1 Replies
3. Shell Programming and Scripting
expect "#"
send "terminal-length 0\r"
expect "#"
send "show mp cpu\r"
expect "#"
send "show mp memory\r"
expect "#"
while {1} {
expect "#"
send "clear counters\r"
sleep 30
... (0 Replies)
Discussion started by: roh_20022002
0 Replies
4. 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
5. Shell Programming and Scripting
Hi,
I am trying to write an expect script. Being a newbie in expect, maybee this is a silly doubt but i am stuck here.
So essentially , i want the o/p of one router command to be captured . Its something like this
Stats
Input Rx : 1234
Input Bytes : 3456
My expect script looks ... (5 Replies)
Discussion started by: ashy_g
5 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. 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
8. 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
9. 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
10. Shell Programming and Scripting
I have a expect file like this
#!/opt/tools/unsupported/expect-5.39/bin/expect
spawn ssh -l user ip
expect_after eof {exit 0}
set timeout 10
log_file /report.txt
expect "Password:" { send "pasword\r" }
expect "$ " { send "date\r" }
expect "$ " { send "readlink /somelink\r" }
set... (7 Replies)
Discussion started by: bebehnaz
7 Replies
LEARN ABOUT REDHAT
err_func_error_string
ERR_error_string(3) OpenSSL ERR_error_string(3)
NAME
ERR_error_string, ERR_error_string_n, ERR_lib_error_string, ERR_func_error_string, ERR_reason_error_string - obtain human-readable error
message
SYNOPSIS
#include <openssl/err.h>
char *ERR_error_string(unsigned long e, char *buf);
char *ERR_error_string_n(unsigned long e, char *buf, size_t len);
const char *ERR_lib_error_string(unsigned long e);
const char *ERR_func_error_string(unsigned long e);
const char *ERR_reason_error_string(unsigned long e);
DESCRIPTION
ERR_error_string() generates a human-readable string representing the error code e, and places it at buf. buf must be at least 120 bytes
long. If buf is NULL, the error string is placed in a static buffer. ERR_error_string_n() is a variant of ERR_error_string() that writes
at most len characters (including the terminating 0) and truncates the string if necessary. For ERR_error_string_n(), buf may not be NULL.
The string will have the following format:
error:[error code]:[library name]:[function name]:[reason string]
error code is an 8 digit hexadecimal number, library name, function name and reason string are ASCII text.
ERR_lib_error_string(), ERR_func_error_string() and ERR_reason_error_string() return the library name, function name and reason string
respectively.
The OpenSSL error strings should be loaded by calling ERR_load_crypto_strings(3) or, for SSL applications, SSL_load_error_strings(3) first.
If there is no text string registered for the given error code, the error string will contain the numeric code.
ERR_print_errors(3) can be used to print all error codes currently in the queue.
RETURN VALUES
ERR_error_string() returns a pointer to a static buffer containing the string if buf == NULL, buf otherwise.
ERR_lib_error_string(), ERR_func_error_string() and ERR_reason_error_string() return the strings, and NULL if none is registered for the
error code.
SEE ALSO
err(3), ERR_get_error(3), ERR_load_crypto_strings(3), SSL_load_error_strings(3) ERR_print_errors(3)
HISTORY
ERR_error_string() is available in all versions of SSLeay and OpenSSL. ERR_error_string_n() was added in OpenSSL 0.9.6.
0.9.7a 2000-09-14 ERR_error_string(3)