GNU parallel double-dashed options not working

2019-07-25 15:05发布

问题:

I am trying to run the following very simple parallel script:

 parallel --eta -j 1 -- "echo hi"

but I get an error

parallel: invalid option -- '-'
parallel [OPTIONS] command -- arguments
    for each argument, run command with argument, in parallel
parallel [OPTIONS] -- commands
    run specified commands in parallel

This happens for every double-dashed option I try to use

回答1:

You are using Tollef's parallel from Moreutils, and not GNU Parallel.



回答2:

If you are not using the Tollef's parallel then try this:

  • Run whereis parallel to get the path of parallel exec binary in your system. Run using the absolute path returned by this command.

Optionally, you can add an alias for this in ~/.bashrc or ~/.zshrc file like:

alias parallel='/usr/local/bin/parallel'