开发者

Preserving 'ls' output format over network

开发者 https://www.devze.com 2023-01-17 16:20 出处:网络
I have 2 machines A and B. I wish to have the output from B printed in a terminal on A. I run the following in a loop on A:

I have 2 machines A and B.

I wish to have the output from B printed in a terminal on A.

I run the following in a loop on A:

nc -l -p 65000

On B, 开发者_StackOverflowall output is tee'd to /dev/tcp/A/65000

This works most of the time, but output from programs such as 'ls' lose their colour and tab formatting. Is there any way to get this to work, such as by writing directly to the tty on A? How would I do this?

Thanks.


You need to use something like unbuffer to fool the program into thinking that it's connected to a tty.

0

精彩评论

暂无评论...
验证码 换一张
取 消