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













0















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









share|improve this question
























  • 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 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











  • Try od -c logfile and check if there are any invisible characters separating the lines.

    – glenn jackman
    Mar 7 at 22:53















0















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









share|improve this question
























  • 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 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











  • Try od -c logfile and check if there are any invisible characters separating the lines.

    – glenn jackman
    Mar 7 at 22:53













0












0








0








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









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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











  • Try od -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












  • 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











  • 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
















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












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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved