I want to run some script over powers of two in parallel. Doing so by giving GNU Parallel a list of the powers of two I want works well:
%>parallel echo {} ::: 32, 64, 128, 256, 512, 1024
32
64
128
256
512
1024
%>
I can also give GNU Parallel a range of values without issue:
%>parallel echo {} ::: {5..10}
5
6
7
8
9
10
%>
But once I include the bit of arithmetic in the GNU Parallel command, I am met with a syntax error:
%>parallel echo $((2**{})) ::: {5..10}
bash: 2**{}: syntax error: operand expected (error token is "{}")
%>
This surprises me because I can generate these values in a for loop as so:
%>for N in {5..10}; do echo $((2**N)); done
32
64
128
256
512
1024
%>
What is the way to do this using GNU Parallel? I am not concerned with order.
--dry-run
would have helped you figure out what was going on. I recommend using--dry-run
every time GNU Parallel does something unexpected.