first commit
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
username=$(whoami)
|
||||
dob=$(grep $username /etc/birthdays | cut -f 3 -d ':')
|
||||
today=$(date +%Y%m%d)
|
||||
age=$(echo "$today - $dob" | bc -l | cut -f 1 -d '.')
|
||||
printf "%s%b" "$age" "\n"
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
age=$(howoldami)
|
||||
|
||||
if [ $age -lt 13 ]; then
|
||||
echo "User is under the age of 13."
|
||||
elif [ $age -ge 13 ] && [ $age -lt 16 ]; then
|
||||
echo "User is under the age of 16, but at least 13."
|
||||
elif [ $age -ge 16 ] && [ $age -lt 18 ]; then
|
||||
echo "User is at least 16, but younger than 18."
|
||||
else
|
||||
echo "User is over 18"
|
||||
fi
|
||||
Reference in New Issue
Block a user