I am trying to run a for loop to traverse multiple folders in the cloned code using the following method
commands:
- folders=`ls`
- for value in ${folders}
- do
- some_code_here
- done
Also, I've tried different ways like
- for value in ${folders}; do
- some_code_here
- done
But none of them works.
You should write for-loops as one-liner. As CodeBuild merges all lines in one command together, you can write for-loops in a readable format as follows:
- folders=`ls`
- for value in $folders;
do
echo $value;
done
- echo "run the next command"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With