updated notes

This commit is contained in:
Hugh Ratsch
2025-02-16 08:17:00 -06:00
parent f66f2cd363
commit 6ce5dea495
+16
View File
@@ -387,4 +387,20 @@ until [ $i -gt 10 ]; do
echo $i
i=$((i+1))
done
```
### Example script to check a user's age
```bash
#!/bin/bash
echo "Please provide me your age: "
read age
if [ "$age" -le 17 ]; then
echo "You cannot enter bars or vote."
elif [ "$age" -ge 18 ] && [ "$age" -le 20 ]; then
echo "You can vote but not enter bars."
else
echo "You are old enough to vote and enter bars."
fi
```