在Unix中使用exec有什么用? [英] what does using exec in unix ?

查看:124
本文介绍了在Unix中使用exec有什么用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个文件.我有两个文件的两个处理程序.然后包含的文件被一个(一行)一个地写入.
例如:
files1:abc
def

files2:xyz

./combine您在做什么" files1.txt files2.txt

程序图像:

你在做什么
abc
xyz
def

我该怎么做?:confused:

i have two files .and i have two process for two files .then contains of files are writen one by one(row).
for example:
files1:abc
def

files2:xyz

./combine "what are you doing" files1.txt files2.txt

program image:

what are you doing
abc
xyz
def

how i make this?:confused:

推荐答案

  • 逐个读取命令行参数

  • 如果该参数指向文件


    • 读取文件的下一行

    • 发送行以输出流

    • 重复直到文件结束

  • Read the command line arguments one by one

  • if the argument refers to a file


    • read next line of file

    • send line to output stream

    • repeat until end of file


这篇关于在Unix中使用exec有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆