updated notes
This commit is contained in:
@@ -387,4 +387,20 @@ until [ $i -gt 10 ]; do
|
|||||||
echo $i
|
echo $i
|
||||||
i=$((i+1))
|
i=$((i+1))
|
||||||
done
|
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
|
||||||
```
|
```
|
||||||
Reference in New Issue
Block a user