For and While loops via command line
I can't seem to find the correct syntax here. So I know how to do a for loop but how do I do an if statement in there or a while statement. For example, I work in storage and our controllers run linux if I want to do a test using a customer python script I can do the following to reset ports on a specific node
for i in `seq 4`; do xcli.py fc_port_reset fc_port=1:fc_port:4:$i; done
However what if I want to make that 4 a variable and go all the way to 9? How do I do multiple variables as well as make a statement that says don't go past 9. I know logically I would do the following. But how would I express them in a command line loop?
int i = 1;
while x < 10; do xcli.py fc_port_reset fc_port=1:fc_port:x:i;if i < 5 i++ else i=1; x++; done
Any help would be appreciated.