We can access anonymous sections through an array, for example:
uci show network.@switch[0]
uci show fstab.@mount[-1]
How do I loop through these arrays? At least how can I get the array size?
This literally works but it is stupid:
index=0;
uci show fstab.@mount[$index] > /dev/null 2>&1;
while [ $? -eq 0 ]
do
index=$((index + 1));
# Your code goes here.
fi