Improve json template looping in variable instead of tmp files
This commit is contained in:
parent
a9fefe0932
commit
6fa84528af
|
@ -12,13 +12,10 @@ j=1
|
||||||
for i in $rWallets; do
|
for i in $rWallets; do
|
||||||
! [[ $j =~ ^(0|1)$ ]] && ((j--))
|
! [[ $j =~ ^(0|1)$ ]] && ((j--))
|
||||||
if [[ $j == 1 ]]; then
|
if [[ $j == 1 ]]; then
|
||||||
dateN=$i
|
jsonTPL=$(sed s/_DATE/$i/g tpl/graph.json)
|
||||||
cp tpl/graph.json rWallets-$i.json
|
|
||||||
sed -i s/_DATE/$i/g rWallets-$i.json
|
|
||||||
j=0
|
j=0
|
||||||
elif [[ $j == 0 ]]; then
|
elif [[ $j == 0 ]]; then
|
||||||
result+=$(sed s/_RWALLET/$i/g rWallets-$dateN.json)
|
result+=$(sed s/_RWALLET/$i/g <<< $jsonTPL)
|
||||||
rm rWallets-$dateN.json
|
|
||||||
[[ $n == 1 ]] && j=1 || j=$((n*2))
|
[[ $n == 1 ]] && j=1 || j=$((n*2))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue