文件名称:Linux-shell)
- 所属分类:
- Linux/Unix编程
- 资源属性:
- [WORD]
- 上传时间:
- 2014-07-09
- 文件大小:
- 29kb
- 下载次数:
- 0次
- 提 供 者:
- r**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
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.
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.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Linux简单的shell实现(附源代码).doc