GNU并行完全不起作用 [英] GNU parallel not working at all
问题描述
一段时间以来,我一直在尝试使用GNU并行,但是我从来没有能够使其完全正常运行!
I have been trying to use GNU parallel for some time, but I have never been able to get it to function at all!
例如,运行(在非空目录中!):
For example, running (in a non-empty directory!):
ls | parallel echo # Outputs single new line
ls | parallel echo echo echo # Outputs three new lines.
ls | parallel echo {} # /bin/bash: {}: command not found
ls | parallel echo '{}' # /bin/bash: {}: command not found
ls | parallel 'echo {}' # Outputs: {}
ls | parallel -IMM 'echo MM' # Outputs: MM
似乎只是将每个参数作为命令执行,这没有任何意义.
It seems that it is simply executing each argument as a command, which makes no sense.
我尝试了bash,zsh,tcsh,csh和sh,但无济于事.
I have tried bash, zsh, tcsh, csh, and sh, to no avail.
推荐答案
当我即将完成此问题的撰写时,我运行parallel --version
报告该版本,却发现:
As I was about to complete writing this question, I ran parallel --version
to report the version, only to find:
警告:您正在使用--toolf.如果正在使用,请使用--gnu.
WARNING: YOU ARE USING --tollef. IF THINGS ARE ACTING WEIRD USE --gnu.
我不清楚为什么默认情况下会设置该标志.不用说,使用--gnu
可行!
It is not clear to me why that flag is set by default. Needless to say, using --gnu
worked!
我认为发布此邮件可以节省一些人的挫败感和困惑.
Thought I would post this to save someone hours of frustration and confusion.
要永久解决此问题(至少在Ubuntu中),请删除/etc/parallel/config
To fix this permanently (in Ubuntu at least), delete the --tollef
flag in /etc/parallel/config
这篇关于GNU并行完全不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!