From 6ce5dea495bde506e537b999f3bf51c94ea0e773 Mon Sep 17 00:00:00 2001 From: Hugh Ratsch Date: Sun, 16 Feb 2025 08:17:00 -0600 Subject: [PATCH] updated notes --- src/rhcsa.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/rhcsa.md b/src/rhcsa.md index e9f696a..057ff8d 100644 --- a/src/rhcsa.md +++ b/src/rhcsa.md @@ -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 ``` \ No newline at end of file