请帮我解决这个问题 [英] please help me with this trouble

查看:45
本文介绍了请帮我解决这个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个名为addecho.sh的shell脚本,它需要1个参数,这是要回显的声音文件名。


来自我的C程序,我称之为:

Hi,

I have a shell script called "addecho.sh", it takes 1 argument which is the sound file name to be echoed.

from my C program, i call this:

展开 | 选择 | Wrap | 行号

推荐答案

关闭在我的头脑中,我可以看到两种方法。第一种也是最简单的方法是修改shell脚本以执行退出/返回调用,execl()将作为int返回。第二种方法是以某种方式重定向stdout(可能是文件),然后分析结果。
Off the top of my head, I can see two ways of doing this. The first, and easiest way is to modify your shell script to perform an exit/return call, which execl() will return as an int. The second way would be to redirect stdout in a way (perhaps to a file) and then analyze the results.



关闭我的头,我可以看到两种方法。第一种也是最简单的方法是修改shell脚本以执行退出/返回调用,execl()将作为int返回。第二种方法是以某种方式(可能是文件)重定向stdout,然后分析结果。
Off the top of my head, I can see two ways of doing this. The first, and easiest way is to modify your shell script to perform an exit/return call, which execl() will return as an int. The second way would be to redirect stdout in a way (perhaps to a file) and then analyze the results.



这是我的shell脚本:

here is my shell script:

展开 | 选择 | Wrap | 行号


I相信你需要像这样使用freopen:
I believe you will need to use freopen like so:
展开 | 选择 | Wrap | 行号


这篇关于请帮我解决这个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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