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
|
||||
! [[ $j =~ ^(0|1)$ ]] && ((j--))
|
||||
if [[ $j == 1 ]]; then
|
||||
dateN=$i
|
||||
cp tpl/graph.json rWallets-$i.json
|
||||
sed -i s/_DATE/$i/g rWallets-$i.json
|
||||
jsonTPL=$(sed s/_DATE/$i/g tpl/graph.json)
|
||||
j=0
|
||||
elif [[ $j == 0 ]]; then
|
||||
result+=$(sed s/_RWALLET/$i/g rWallets-$dateN.json)
|
||||
rm rWallets-$dateN.json
|
||||
result+=$(sed s/_RWALLET/$i/g <<< $jsonTPL)
|
||||
[[ $n == 1 ]] && j=1 || j=$((n*2))
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue