Search code examples
pythongnu-parallel

GNU parallel escaped space of quoted arguments and python failed to parse the flags


i want to run parallel "python test.py --flag1 {}" ::: '--flag2 --flag3' '--flag4 --flag5' but my python failed to parse the flags and execute

when i try to dry run, the output is

python test.py --flag1 --flag2\ --flag3
python test.py --flag1 --flag4\ --flag5

how can i make parallel not escape my space betweem flags? e.g. python test.py --flag1 --flag2 --flag3 without the escape character

almost tried all relevant search results e.g. eval, -q, but they seem unable to solve this, many thanks!


Solution

  • Parallel version < 20190722:

    parallel eval python test.py --flag1 {} ::: '--flag2 --flag3' '--flag4  --flag5'
    

    Parallel version >= 20190722:

    parallel python test.py --flag1 {=uq=} ::: '--flag2 --flag3' '--flag4  --flag5'