How can I prevent expect from ignoring new lines?Expect script, working for years, behaves unexpectedly with new Expect versionI need help creating a loop in expectRPM not getting installed while logging using expect scriptshow ip interface brief in expect scriptHow can I scroll the terminal output with Expect Script?Expect Script through Putty works but not when called by scripts executed via httpexpect script regex not workingLooping over lines from a file in expectHow can I share a spawned SSH process between multiple procedures in TCL Expect?Store the output of previous command issued by root user in a variable
Why were 5.25" floppy drives cheaper than 8"?
How obscure is the use of 令 in 令和?
In the UK, is it possible to get a referendum by a court decision?
How do conventional missiles fly?
How exploitable/balanced is this homebrew spell: Spell Permanency?
What Exploit Are These User Agents Trying to Use?
What is the most common color to indicate the input-field is disabled?
Forgetting the musical notes while performing in concert
How to find if SQL server backup is encrypted with TDE without restoring the backup
Was the old ablative pronoun "med" or "mēd"?
Can compressed videos be decoded back to their uncompresed original format?
Fair gambler's ruin problem intuition
How to show a landlord what we have in savings?
What does the same-ish mean?
GFCI outlets - can they be repaired? Are they really needed at the end of a circuit?
Why is the sentence "Das ist eine Nase" correct?
How to Prove P(a) → ∀x(P(x) ∨ ¬(x = a)) using Natural Deduction
Unlock My Phone! February 2018
OP Amp not amplifying audio signal
Ambiguity in the definition of entropy
What reasons are there for a Capitalist to oppose a 100% inheritance tax?
In Bayesian inference, why are some terms dropped from the posterior predictive?
Different meanings of こわい
Am I breaking OOP practice with this architecture?
How can I prevent expect from ignoring new lines?
Expect script, working for years, behaves unexpectedly with new Expect versionI need help creating a loop in expectRPM not getting installed while logging using expect scriptshow ip interface brief in expect scriptHow can I scroll the terminal output with Expect Script?Expect Script through Putty works but not when called by scripts executed via httpexpect script regex not workingLooping over lines from a file in expectHow can I share a spawned SSH process between multiple procedures in TCL Expect?Store the output of previous command issued by root user in a variable
In my current, draft script, the show
command output is fine, but once I hit the "conf" commands, the output is pressed together. How do I fix this?
set timeout 20
spawn ssh -l manager 192.168.41.10.10
expect "manager@192.168.10.10's password:"
send "adminr"
expect "Press any key to continue"
send "j"
log_file hp.log
send "show vlan 10r"
expect "newsw*"
send "confr"
expect "newsw*(config)"
send "r"
send "vlan 45r"
expect "newsw*"
send "tagged 3r"
send "exitr"
send "exitr"
The is what the log looks like for the "conf" section and related commands. The output is running together. You can see a piece of the "show vlan 45" at the end.
newswitch# confnewswitch(config)# vlan 45newswitch(vlan-45)# tagged 3newswitch(vlan-45)# exitnewswitch(config)# exitnew$ Status and Counters - VLAN Information - VLAN 45
VLAN ID : 45
Name : VLAN45
Here is the proper / desired output. I would think that it would look like this:
newswitch#
conf
newswitch(config)# vlan 45
newswitch(vlan-45)# tagged 3
newswitch(vlan-45)# exit
newswitch(config)# exit
newswitch$ show vlan 45 ....and so forth
expect
|
show 2 more comments
In my current, draft script, the show
command output is fine, but once I hit the "conf" commands, the output is pressed together. How do I fix this?
set timeout 20
spawn ssh -l manager 192.168.41.10.10
expect "manager@192.168.10.10's password:"
send "adminr"
expect "Press any key to continue"
send "j"
log_file hp.log
send "show vlan 10r"
expect "newsw*"
send "confr"
expect "newsw*(config)"
send "r"
send "vlan 45r"
expect "newsw*"
send "tagged 3r"
send "exitr"
send "exitr"
The is what the log looks like for the "conf" section and related commands. The output is running together. You can see a piece of the "show vlan 45" at the end.
newswitch# confnewswitch(config)# vlan 45newswitch(vlan-45)# tagged 3newswitch(vlan-45)# exitnewswitch(config)# exitnew$ Status and Counters - VLAN Information - VLAN 45
VLAN ID : 45
Name : VLAN45
Here is the proper / desired output. I would think that it would look like this:
newswitch#
conf
newswitch(config)# vlan 45
newswitch(vlan-45)# tagged 3
newswitch(vlan-45)# exit
newswitch(config)# exit
newswitch$ show vlan 45 ....and so forth
expect
I don't understand the bit in the middle: does that show up in the log file or on the screen? Can you improve the formatting of your question. Formatting hint: you can separate code blocks with a normal paragraph or with a non-indented empty HTML comment.
– glenn jackman
Mar 7 at 21:28
Ah yes. I have put the run-on message(s) in brackets now.
– jogle900
Mar 7 at 21:32
Hmm. I wonder if this is a consequence of usingr
in the send commands. Try usingn
instead
– glenn jackman
Mar 7 at 21:48
I know , it's strange. I have tried /n and /r and multiple, combinations, etc. Frustrated.
– jogle900
Mar 7 at 22:38
Tryod -c logfile
and check if there are any invisible characters separating the lines.
– glenn jackman
Mar 7 at 22:53
|
show 2 more comments
In my current, draft script, the show
command output is fine, but once I hit the "conf" commands, the output is pressed together. How do I fix this?
set timeout 20
spawn ssh -l manager 192.168.41.10.10
expect "manager@192.168.10.10's password:"
send "adminr"
expect "Press any key to continue"
send "j"
log_file hp.log
send "show vlan 10r"
expect "newsw*"
send "confr"
expect "newsw*(config)"
send "r"
send "vlan 45r"
expect "newsw*"
send "tagged 3r"
send "exitr"
send "exitr"
The is what the log looks like for the "conf" section and related commands. The output is running together. You can see a piece of the "show vlan 45" at the end.
newswitch# confnewswitch(config)# vlan 45newswitch(vlan-45)# tagged 3newswitch(vlan-45)# exitnewswitch(config)# exitnew$ Status and Counters - VLAN Information - VLAN 45
VLAN ID : 45
Name : VLAN45
Here is the proper / desired output. I would think that it would look like this:
newswitch#
conf
newswitch(config)# vlan 45
newswitch(vlan-45)# tagged 3
newswitch(vlan-45)# exit
newswitch(config)# exit
newswitch$ show vlan 45 ....and so forth
expect
In my current, draft script, the show
command output is fine, but once I hit the "conf" commands, the output is pressed together. How do I fix this?
set timeout 20
spawn ssh -l manager 192.168.41.10.10
expect "manager@192.168.10.10's password:"
send "adminr"
expect "Press any key to continue"
send "j"
log_file hp.log
send "show vlan 10r"
expect "newsw*"
send "confr"
expect "newsw*(config)"
send "r"
send "vlan 45r"
expect "newsw*"
send "tagged 3r"
send "exitr"
send "exitr"
The is what the log looks like for the "conf" section and related commands. The output is running together. You can see a piece of the "show vlan 45" at the end.
newswitch# confnewswitch(config)# vlan 45newswitch(vlan-45)# tagged 3newswitch(vlan-45)# exitnewswitch(config)# exitnew$ Status and Counters - VLAN Information - VLAN 45
VLAN ID : 45
Name : VLAN45
Here is the proper / desired output. I would think that it would look like this:
newswitch#
conf
newswitch(config)# vlan 45
newswitch(vlan-45)# tagged 3
newswitch(vlan-45)# exit
newswitch(config)# exit
newswitch$ show vlan 45 ....and so forth
expect
expect
edited Mar 8 at 2:17
Pikachu the Purple Wizard
2,03761429
2,03761429
asked Mar 7 at 21:19
jogle900jogle900
13
13
I don't understand the bit in the middle: does that show up in the log file or on the screen? Can you improve the formatting of your question. Formatting hint: you can separate code blocks with a normal paragraph or with a non-indented empty HTML comment.
– glenn jackman
Mar 7 at 21:28
Ah yes. I have put the run-on message(s) in brackets now.
– jogle900
Mar 7 at 21:32
Hmm. I wonder if this is a consequence of usingr
in the send commands. Try usingn
instead
– glenn jackman
Mar 7 at 21:48
I know , it's strange. I have tried /n and /r and multiple, combinations, etc. Frustrated.
– jogle900
Mar 7 at 22:38
Tryod -c logfile
and check if there are any invisible characters separating the lines.
– glenn jackman
Mar 7 at 22:53
|
show 2 more comments
I don't understand the bit in the middle: does that show up in the log file or on the screen? Can you improve the formatting of your question. Formatting hint: you can separate code blocks with a normal paragraph or with a non-indented empty HTML comment.
– glenn jackman
Mar 7 at 21:28
Ah yes. I have put the run-on message(s) in brackets now.
– jogle900
Mar 7 at 21:32
Hmm. I wonder if this is a consequence of usingr
in the send commands. Try usingn
instead
– glenn jackman
Mar 7 at 21:48
I know , it's strange. I have tried /n and /r and multiple, combinations, etc. Frustrated.
– jogle900
Mar 7 at 22:38
Tryod -c logfile
and check if there are any invisible characters separating the lines.
– glenn jackman
Mar 7 at 22:53
I don't understand the bit in the middle: does that show up in the log file or on the screen? Can you improve the formatting of your question. Formatting hint: you can separate code blocks with a normal paragraph or with a non-indented empty HTML comment.
– glenn jackman
Mar 7 at 21:28
I don't understand the bit in the middle: does that show up in the log file or on the screen? Can you improve the formatting of your question. Formatting hint: you can separate code blocks with a normal paragraph or with a non-indented empty HTML comment.
– glenn jackman
Mar 7 at 21:28
Ah yes. I have put the run-on message(s) in brackets now.
– jogle900
Mar 7 at 21:32
Ah yes. I have put the run-on message(s) in brackets now.
– jogle900
Mar 7 at 21:32
Hmm. I wonder if this is a consequence of using
r
in the send commands. Try using n
instead– glenn jackman
Mar 7 at 21:48
Hmm. I wonder if this is a consequence of using
r
in the send commands. Try using n
instead– glenn jackman
Mar 7 at 21:48
I know , it's strange. I have tried /n and /r and multiple, combinations, etc. Frustrated.
– jogle900
Mar 7 at 22:38
I know , it's strange. I have tried /n and /r and multiple, combinations, etc. Frustrated.
– jogle900
Mar 7 at 22:38
Try
od -c logfile
and check if there are any invisible characters separating the lines.– glenn jackman
Mar 7 at 22:53
Try
od -c logfile
and check if there are any invisible characters separating the lines.– glenn jackman
Mar 7 at 22:53
|
show 2 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55052960%2fhow-can-i-prevent-expect-from-ignoring-new-lines%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55052960%2fhow-can-i-prevent-expect-from-ignoring-new-lines%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I don't understand the bit in the middle: does that show up in the log file or on the screen? Can you improve the formatting of your question. Formatting hint: you can separate code blocks with a normal paragraph or with a non-indented empty HTML comment.
– glenn jackman
Mar 7 at 21:28
Ah yes. I have put the run-on message(s) in brackets now.
– jogle900
Mar 7 at 21:32
Hmm. I wonder if this is a consequence of using
r
in the send commands. Try usingn
instead– glenn jackman
Mar 7 at 21:48
I know , it's strange. I have tried /n and /r and multiple, combinations, etc. Frustrated.
– jogle900
Mar 7 at 22:38
Try
od -c logfile
and check if there are any invisible characters separating the lines.– glenn jackman
Mar 7 at 22:53