[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNU Parallel Bug Reports parallel can't ressigned variablen in the s
From: |
Ole Tange |
Subject: |
Re: GNU Parallel Bug Reports parallel can't ressigned variablen in the same context in same file |
Date: |
Thu, 31 May 2012 12:30:05 +0200 |
On Thu, May 31, 2012 at 12:02 PM, gmail <address@hidden> wrote:
:
> My aim is that shell variable which in parallel can modify in the whole
> shell script context ,
>
> the sample code below like that:
> enviroment : centos 5.5 x64 (bash 3.2.25)
> ##############
> #!/bin/bash
> domains=('www1' 'www2')
> counter=0
> parallel -j 2 "if [ -z $counter ];then echo 'var no set
> ';fi;counter=$((counter + 1));echo $counter {1} " ::: address@hidden
>
> ##############
> the variable counter no to be increased when looping the array domains ,
> counter should be 2,but in parallel it print zero( no changed)
Can you use {#} (alias for $PARALLEL_SEQ)?
parallel echo {#} {} ::: a b c
/Ole
--
https://www.gnu.org/software/parallel/merchandise.html
¿ǝsıpuɐɥɔɹǝɯ lǝllɐɹɐd ∩N⅁ ɹnoʎ pǝɹǝpɹo noʎ ǝʌɐH
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: GNU Parallel Bug Reports parallel can't ressigned variablen in the same context in same file,
Ole Tange <=