Quantcast
Channel: Active questions tagged expect - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 157

Expect: print a multi-line string all at once using echo

$
0
0

I have the following section in my code expect code:

set command "echo $output"spawn bashexpect "$ "send "$command\r"expect "$command\r\n"

Where output is a multi-line string obtained from $expect_out(buffer).

I get the output:

$ echo thisthis$ isis: command not found$ a multilinea: command not found$string

Is there any way I can obtain the above string instead in a single sequence, the same way we'd echo a multiline string on bash? I'm using echo because I want to do some Bash post-processing with a pipe later.


Viewing all articles
Browse latest Browse all 157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>