linux中的line函数,Linux-shell)

 2023-09-07 阅读 25 评论 0

摘要:Linux-shell)所属分类:单片机开发开发工具:Visual C++文件大小:29KB下载次数:7getline函数怎么用、上传日期:2014-07-09 13:35:49上 传 者:rrr说明:1、首先利用readline()函数读到用户输入的shell命令,采用一

Linux-shell)

所属分类:单片机开发

开发工具:Visual C++

文件大小:29KB

下载次数:7

getline函数怎么用、上传日期: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.)

shell读取文件?近期下载者:

相关文件:

收藏者:

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/3/17738.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息