linux中的line函数,Linux-shell)

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.)

近期下载者:

相关文件:

收藏者:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值