Skip to content

Creating this repo for uploading all resources regarding Bash script tutorial

License

Notifications You must be signed in to change notification settings

devopshobbies/bash-script-tutorial

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Session5

Challenge four description

  • 1 . ask the user about their age and major then store them in variables, AGE and MAJOR.

  • 2 . check if they are 18 or above and echo "you are not old enough!" if they are not.

  • 3 . if they were older than 18 (passed the first test) check if their major is "Engineering" (elif) then tell them "You have to study Engineering to be part of us, it doesn't seem so :))"

  • 4 . otherwise, echo "You can take part for sure!"

Hints to remember

  • when defining variables you must not have any space around = (equall sign).

  • if you use variable with extra data such as String(concatenation) you should enclose the variable like "some data ${variable_name}, some other data"

  • variables are case sensitive and you should define them with UPPERCASE when declaring a shell or environment varaiable.

  • arithmetic operators including -ne, -eq, -gt, -lt,etc are solely used for checking numbers.

  • leave some space in condition part when using if and elif is neccessary.

bash-script-tutorial

Bash scripts related to every session of this tutorial will be stored in isolated branches named after their session name.

How to use

You can access the main code and the challenge answer key related to every session at their own branch.

About

Creating this repo for uploading all resources regarding Bash script tutorial

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages