Answer the question
In order to leave comments, you need to log in
Mikrotik+SSH parse the output. How to make ssh pass a large screen width?
Good afternoon.
I connect via ssh to the mikrotik router, execute the command to request ip to the address sheet.
If I connect with my hands, the output is more complete. Example:
If I connect to execute one command from bash, the output is truncated. Example:
It feels like a shorter "screen" width is being transmitted.
Tried the -t switch. But then after executing the command, there is no shutdown. So it hangs in the ssh'e of the router.
Please tell me how to configure ssh to pass a large "window width".
Answer the question
In order to leave comments, you need to log in
The easiest option is to upgrade RouterOS to version 7 (it has been stable for a long time). They fixed the width of the terminal. Here is an example of executing the same command in 6 and 7:
But if you have to suffer with the 6th, then as a solution is to abandon print in favor of the put / get combination and getting only the necessary columns.
> Tried the -t switch. But then after executing the command, there is no shutdown. So it hangs in the ssh'e of the router.
I didn’t work specifically with Mikrotiks, but maybe there you can send several commands, as with a regular shell and through "&&" or ";" besides the given command, add another logout (or whatever it is in Mikrotik / quit or something)?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question