bash for add one 1

bash for add one

i=$((i+1))

Here is what the above code is Doing:
1. It’s creating a variable called i and setting it to 0.
2. It’s creating a variable called names and setting it to an empty list.
3. It’s creating a while loop that will run as long as i is less than 5.
4. It’s asking the user to input a name.
5. It’s adding that name to the list of names.
6. It’s incrementing i by 1.
7. It’s printing the list of names.

Similar Posts