5

从命令行parallel echo {} ::: A B C执行的命令返回正确的结果,而在 bash 脚本中调用时返回错误:

这是脚本:

#script.bash
#!/usr/bin/env bash

parallel echo {} ::: A B C

这是输出:

bash script.bash
/bin/bash: {}: command not found
/bin/bash: ::: command not found
/bin/bash: A: command not found
/bin/bash: B: command not found
/bin/bash: C: command not found

知道为什么以及如何在 bash 脚本中正确调用 GNU 并行吗?

4

1 回答 1

6

显然,当您从脚本运行该--tollef开关(不支持该语法)时,它会被启用。:::

您可以通过启用--gnu开关来修复它

parallel --gnu echo {} ::: A B C
于 2014-01-13T12:09:39.947 回答