Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Unix/Linux Tutorials | Finding Biggest of 3 Numbers | by Durga Sir
Play lesson

Unix/Linux Tutorial Videos - Unix/Linux Tutorials | Finding Biggest of 3 Numbers | by Durga Sir

5.0 (2)
28 learners

What you'll learn

This course includes

  • 44.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

Finding Biggest of 3 Numbers: ====================== 1. How to read data dynamically from the keyboard (read) 2. if-else syntax in shell scripting 3. How to use comparison operators in shell script ( -gt, -lt, -ge, -le, -eq, -ne) 4. How to use logical operators in shell script ( -a, -o , -n) #! /bin/bash read -p "Enter First Number:" a read -p "Enter Second Number:" b read -p "Enter Third Number:" c if [ $a -gt $b -a $a -gt $c ] then echo "Biggest Number: $a" elif [ $b -gt $c ] then echo "Biggest Number: $b" else echo "Biggest Number: $c" fi durgasoft@durgasoft:~/scripts$ ./test.sh Enter First Number:10 Enter Second Number:20 Enter Third Number:30 Biggest Number: 30 durgasoft@durgasoft:~/scripts$ ./test.sh Enter First Number:300 Enter Second Number:200 Enter Third Number:500 Biggest Number: 500 durgasoft@durgasoft:~/scripts$ ./test.sh Enter First Number:-10 Enter Second Number:-20 Enter Third Number:-30 Biggest Number: -10

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere