updated notes
This commit is contained in:
@@ -388,3 +388,19 @@ until [ $i -gt 10 ]; do
|
||||
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
|
||||
```
|
||||
Reference in New Issue
Block a user