I am trying to assign values to variables using GNU Parallel:
$ parallel --dry-run --xapply a{1}={2} ::: a b c ::: 5 6 7
aa=5
ab=6
ac=7
But the execution seems not to be working OK:
$ parallel --xapply a{1}={2} ::: a b c ::: 5 6 7
$ echo $aa
$ echo $ab
$ echo $ac
Empty values in all cases.
What is going on, and how could I assign a value to a variable by using GNU Parallel?
Further data:
- I know there are ways to make GNU Parallel inherit the variables from its parent process, but in this case what I want is the reverse.
parallel a={} ::: 1 2 3
– Ole Tange Feb 26 '18 at 12:02parallel {1}={2} ::: a b c :::+ 1 2 3
(I'm brand new to this, sorry if the syntax isn't right) to do something more useful. Other decisions, like allowing ungrouped output without line buffering, make me think that the philosophy is to give you control, and it's up to you to prevent races, correct them after the fact, or somehow make use of the result. Just my first impression. – John P Jan 08 '19 at 02:51