How to pass variables to parallel command

How do I pass different values to a single parallel command:

I tried this:

parallel ::: 'X="aa"' 'X="bb"' ::: echo ${X}

which only prints two empty lines, as if the value of X is not set. I tried with echo $X with the same result.

I expected it to print

aa
bb


Read more here: https://stackoverflow.com/questions/64902116/how-to-pass-variables-to-parallel-command

Content Attribution

This content was originally published by alfC at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: