为 Mac OS X 创建 bash 的替代方案
shell 是普通的 CLI 应用程序,还是与从标准输入接受输入并在标准输出上输出结果的应用程序不同?
Is a shell a normal CLI application, or is it different from an application that accepts input from standard input, and outputs the result on standard output?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
shell 读取标准输入,根据需要写入标准输出/错误,并执行其他程序。如果您对编写一个程序感兴趣,我建议您阅读 " UNIX 系统编程”,作者:Kay Robbins 和 Steve Robbins。我还没有读过这个版本,原版名为“实用 UNIX 编程”。它确实包含专门讨论进程管理的部分,其中包括编写一个非常基本的 shell。如果您还没有阅读“UNIX 环境中的高级编程” 作者:Stevens,那么我也建议您阅读它。
A shell reads standard input, writes to standard output/error as appropriate, and executes other programs. If you are interested in what it takes to write one, I would recommend reading "UNIX Systems Programming" by Kay Robbins and Steve Robbins. I haven't read this version, the original copy was named "Practical UNIX Programming". It does contain sections devoted to process management that include writing a very basic shell. If you haven't read "Advanced Programming in the UNIX Environment" by Stevens, then I would suggest reading it as well.
不,shell 只是从 stdin 读取并输出到 stdout。显然它的作用远不止于此,但这就是基础。
No, a shell just reads from stdin and outputs to stdout. Obviously it does do more than that, but that's the basics.