英文:
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
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论