Skip to content

How do I redirect a command output to file in custom rules? #1775

Answered by waruqi
xq114 asked this question in Q&A
Discussion options

You must be logged in to vote

batchcmds 是序列化的 cmd list,并没有立即执行,无法去 iorunv的返回值,可以走 runv(program, argv, {stdout = "", stderr = "", stdin = ""}) 。execv 也可以

stdout 可以传递 文件路径,或者 io.open的文件对象,或者 pipe 对象。。都可以实现重定向

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@xq114
Comment options

@waruqi
Comment options

Answer selected by xq114
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants