http://www.gnu.org/software/libc/manual/html_node/Implementing-a-Shell.htmlhttp://stephen-brennan.com/2015/01/16/write-a-shell-in-c/http://stackoverflow.com/questions/1500004/how-can-i-implement-my-own-basic-unix-shell-in-c 希望能帮到你(我并没细读过…………)
https://github.com/David-Guo/myshell 这是我上 OS 课时,写的一个 mini shell,代码量300行左右支持以下功能: 解释执行命令 内建命令cd exit pipe 管道 fg 前台执行命令 bg 后台执行命令 彩色提示符 Ctrl -Z Ctrl -C 信号处理 希望能给你提供一个思路和 demo 。
http://www.gnu.org/software/libc/manual/html_node/Implementing-a-Shell.html
http://stephen-brennan.com/2015/01/16/write-a-shell-in-c/
http://stackoverflow.com/questions/1500004/how-can-i-implement-my-own-basic-unix-shell-in-c
希望能帮到你
(我并没细读过…………)