--Summary of how to write a for statement that repeats processing a specified number of times with ShellScript Bash
--The following is an example of a for statement that repeats processing a specified number of times.
--((i = 0; i <specified number of times; i ++))
is ((i starts from 0; processing ends when this number is reached; i plus 1 for each processing))) It means
#!/bin/bash
for ((i=0; i<Specified number of times; i++)); do
Processing that you want to repeat the specified number of times
done
--The output of the expected value is described below.
*
**
***
****
*****
--The process for outputting the expected value described above is described below.
#!/bin/bash
FOO_1="*"
FOO_2="*"
for ((i=0; i<5; i++)); do
echo "${FOO_1}"
FOO_1="${FOO_1}""${FOO_2}"
done
Recommended Posts