fgimian / paramiko-expect

A Python expect-like extension for the Paramiko SSH library which also supports tailing logs.
MIT License
205 stars 78 forks source link

How to save the output of unix command into variable and do not show output to monitor #41

Open steventran1983 opened 6 years ago

steventran1983 commented 6 years ago

Hello , I have a question and need your help. my code is : with SSHClientInteraction(client, timeout=10, display=True) as interact: interact.expect(PROMPT) interact.send(command) (ex : ls -lrth) interact.expect(PROMPT,timeout=20) cmd_output_command = interact.current_output_clean I do not want the output show on the monitor after I send(command) , is there anyway to hidden those. I just need save output to variable and will re-format the output appropriate with requirement.