From 4a1a665fded057ef1ee362cca5270fe3d50d32af Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Mon, 15 Dec 2025 18:39:09 +0200 Subject: [PATCH] MyProject --- Bash_scripting/myproject.sh | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 Bash_scripting/myproject.sh diff --git a/Bash_scripting/myproject.sh b/Bash_scripting/myproject.sh new file mode 100755 index 0000000..c1a984d --- /dev/null +++ b/Bash_scripting/myproject.sh @@ -0,0 +1,65 @@ +#!/bin/bash +user=$(whoami) +echo "Welcomem, $user. Please enjoy this short presentation! " + +read -p "Please enter a number:" num +if (( num%2==0 )) +then + echo "$num is even" + +else + echo "$num is odd" + +fi + +for (( i=0; i<3; i++ )) +do +read -p "You have three attempts to find the secret recipe, so please enter another number between 1 and 10: " num2 +secret=1 + +if (( num2==secret )) +then + i=3 + echo "You have found the secret recipe of Coca Cola!! ^_^" + +else + echo "You were so close to finding the secret recipe :(" + +fi +done + +echo "Let's try something else. Please type 1 or 0 (1 for false, 0 for true)" + +for (( j=0; j<=2; ++j )) +do + +if (( j==0 )) +then + read -p "Are there any fish with legs? 1 or 0: " Answer + if (( Answer==0 )) + then + echo "Your answer is correct! Mudskippers are the champions of land-walking fish, but we also have the Lungfish, Walking Catfish, Sea Robins, Frogfish or Handifsh" + else + echo "Your answer is not correct, but don't worry, you are not the only one :D" + fi +elif (( j==1 )) +then + read -p "Are there any animals with no toes? 1 or 0: " Answer + if (( Answer!=0 )) + then + echo "Your answer is correct! Horses are commonly known for having just a toe under their hooves, but one toe is still more than none!" + else + echo "Your answer is not correct. There is no animal without any toes. Hooves are modified toenails covering the tips of toes." + fi +else + read -p "Is the blue whale the heaviest animal on this planet? 1 or 0: " Answer + if (( Answer==0 )) + then + echo "Your answer is correct! The second heaviest animal ever to have existed on Earth is the fin whale (Balaenoptera physalus), with some historical estimates reaching up to 130 tons" + else + echo "Your answer is not correct. Blue whales are widely regarded as the heaviest animals to have ever existed on Earth, with recorded weights up to 190 - 200 tons" + fi +fi +done + +