updated notes

This commit is contained in:
Hugh Ratsch
2025-02-16 07:35:46 -06:00
parent b139ae7a8d
commit f66f2cd363
+31
View File
@@ -357,3 +357,34 @@ else
echo "The file '$user_file' does not exist." echo "The file '$user_file' does not exist."
fi fi
``` ```
### for loop
```bash
#!/bin/bash
for i in 1..10; do
echo $i
done
```
### while loop
```bash
#!/bin/bash
i=1
while [ $i -le 10 ]; do
echo $i
i=$((i+1))
done
```
### until loop
```bash
#!/bin/bash
i=1
until [ $i -gt 10 ]; do
echo $i
i=$((i+1))
done
```