小编Nik*_*hhi的帖子

带有标准输入/标准输出重定向的 xargs

我想运行:

./a.out < x.dat > x.ans
Run Code Online (Sandbox Code Playgroud)

对于目录A中的每个 * .dat文件。

当然,它可以通过 bash/python/任何脚本来完成,但我喜欢写性感的单行。我所能达到的只有(仍然没有任何标准输出):

ls A/*.dat | xargs -I file -a file ./a.out
Run Code Online (Sandbox Code Playgroud)

但是-axargs 中的不理解 replace-str 'file'。

谢谢你的帮助。

io-redirection xargs

27
推荐指数
1
解决办法
3万
查看次数

标签 统计

io-redirection ×1

xargs ×1