Hello,
I am trying to make use of ticktick.sh to loop over some elements in a json array, and I'm having some issues, that I don't see addressed in the README, or examples. Hopefully, someone here will be able to help me out.
The script below shows how indexing with a variable seems to not work. My intent is to make use of this construct in a for loop, once I figure out the proper mechanism.
Perhaps there is a better way to do it that I'm not seeing.
Any insight is greatly appreciated.
#!/bin/bash -e
. ./TickTick/ticktick.sh
``
manifest = {
"repos": [
{
"name": "test1",
"src": "test1.git"
},
{
"name": "test2",
"src": "test2.git"
}
]
}
``
# works
echo ``manifest.repos[0].name``
#broken
i=0
echo ``manifest.repos[$i].name``