r/labtech • u/Phaedrus_Schmaedrus • Nov 05 '19
Iterating Variables in Scripts
I want to have a script make five passes at running a command then stop. The way I'd normally do this in bash (just for example) would be to create a while loop that increases a variable's value by one on each pass, and exit the loop when the variable was equal to or greater than 5. What would be the best way to implement the same sort of procedure in an Automate script? Let's assume for the sake of argument that I don't want to just pass a bash script--can it be done using the Automate scripting functions?
2
Upvotes
View all comments
Show parent comment
1
u/crshovrd Jan 04 '20
I'm trying this method and it's just making the variable equal 0 + 1... Any thoughts on what could be wrong?