Linux-shell)
所属分类:单片机开发
开发工具:Visual C++
文件大小:29KB
下载次数:7
上传日期:2014-07-09 13:35:49
上 传 者:rrr
说明: 1、首先利用readline()函数读到用户输入的shell命令,采用一个数组来保存shell命令,数组有固定的大小。
2、在main()函数中根据字符串中是否存在 "&" 字符判断是否为后台进程。如果是后台命令则判断是否是多条指令,如果不是将分割后的命令传递给pipel()函数,如果是的话分割之后利用while循环将命令传递给pipel()函数。如果不是后台进程,需要用waitpid()函数等待子进程结束后父进程才继续。
(1, we use readLine () function to read user input shell command, use an array to save the shell command, arrays are fixed size.
2, in the main () function according to the string in the existence of "&" characters to determine whether the background process. If the background is to determine whether the command is a command, if not pass after segmentation command for the pipel () function, if is the words segmentation based on while cycle to pass commands to pipel () function. If not the background process, need to use waitpid () function to wait for the child process to end a process to continue.)
近期下载者:
相关文件:
收藏者: