Arguments tab, but there seems to be" />
开发者

Executable pipe input?

开发者 https://www.devze.com 2023-03-15 21:08 出处:网络
How to run executable in Xcode with piped input? For example: echo \"abc\" | myexec I know I can set arguments to my executable in the Executable [name] Info > Arguments tab, but there seems to be

How to run executable in Xcode with piped input? For example:

echo "abc" | myexec

I know I can set arguments to my executable in the Executable [name] Info > Arguments tab, but there seems to be no option to prefix it or something.

I see "Use Pipe for standard input/output" in the General tab, bu开发者_如何转开发t how to work with it? Doesn't seem to change a thing.

I'm using Xcode 3.2.6.


I don't know if this is the most elegant way, but could you have a Shell Script build phase that shunts the output of the first command into a file (echo "abc" > tempfile) and then call your executable with (myexec < tempfile)?

I haven't found much online yet besides this now-broken link that explains the use of "Use Pipe for standard input/output".

0

精彩评论

暂无评论...
验证码 换一张
取 消