如何在没有Tcl的情况下实现无缓冲?

huangapple go评论50阅读模式
英文:

How can I achieve unbuffering without Tcl?

问题

我是“unbuffer”的快乐用户,但现在面临一个没有安装Tcl的系统(而且我没有root权限)。

我能在不使用Tcl的情况下达到相同的效果吗?脚本解决方案很好,但我甚至不介意编写一些C代码...

英文:

I'm a happy user of unbuffer, but am now faced with a system that doesn't have Tcl installed (and I don't have root privileges).

Can I achieve the same effect without using Tcl? A scripting solution would be nice, but I would not be averse to even writing some C...

答案1

得分: 2

如果你从源代码构建 Tcl 和 Expect,你可以配置它们以在没有 root 访问权限的个人帐户下安装。

英文:

If you build Tcl and Expect from source you can configure them to install under a personal account without root access.

答案2

得分: 1

阅读stdbuf的手册页,看起来以下的操作可能会起作用:

stdbuf --output=0

... 然后是你的命令,在同一条命令行上(就像你在使用unbuffer时一样)。

如果你愿意的话,你还可以使用--input=0--error=0来“unbuffer”你的stdin和/或stderr。

英文:

Reading the man page of stdbuf, it seems the following might do it:

stdbuf --output=0

... followed by your command, on the same command-line (like you're used to with unbuffer).

You can also "unbuffer" your stdin and/or stderr if you like, with --input=0 and --error=0.

huangapple
  • 本文由 发表于 2023年3月12日 19:33:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/75712832.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定