c - Pipeline和Tail命令在C语言中应该如何实现?

标签 c unix pipe tail

如何编写实现以下命令的 C 程序:

tail -5 /etc/passwd | grep e | sort  > result.txt

C 程序应该包含什么? r_readr_write在C程序中应该如何实现?

最佳答案

coreutils 是开源的,因此您可以阅读它们的源代码。这是一个链接,您可以在其中找到 coreutils 的源代码 http://git.savannah.gnu.org/cgit/coreutils.git/tree/src

关于c - Pipeline和Tail命令在C语言中应该如何实现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29511673/

相关文章:

c - C 中的反向字符串 - 我做错了什么?

c - 得到结果多 1,除数计数 程序 - C

c - 确定 fork 后的内存是否为写时复制

c - Unix 管道实验挂起

c - 将 GCC __sync 扩展用于可移植的 C 库

自定义 WM_APP 消息未发布到消息队列中

bash - 如果没有扩展名为 .c 的文件,则 for 循环包括通配符 (*.c)。我怎么走?

unix - 数控命令: inverse host lookup failed: Unknown host

Angular 2货币管道格式

C - 使用 printf 和 scanf 的管道..暂停