文件名称:Linux-shell)
-
所属分类:
- 标签属性:
- 上传时间:2014-07-09
-
文件大小:29.12kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.