mirror of
https://github.com/techarkit/shell-scripting-tutorial.git
synced 2026-01-14 03:01:42 +00:00
Create if-else-statement
if else statement. control statement example.
This commit is contained in:
19
if-else-statement
Normal file
19
if-else-statement
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
#Purpose: If else statement example
|
||||
#Version:1.0
|
||||
#Created Date: Sat May 12 23:49:15 IST 2018
|
||||
#Modified Date:
|
||||
#Website: https://arkit.co.in
|
||||
#Author: Ankam Ravi Kumar
|
||||
# START #
|
||||
echo -e "Enter any value> \c"
|
||||
read -r a
|
||||
echo -e "Enter any value: \c"
|
||||
read -r b
|
||||
|
||||
if [ $a -gt $b ]; then
|
||||
echo "$a is greater than $b"
|
||||
else
|
||||
echo "$b is greater than $a"
|
||||
fi
|
||||
# END #
|
||||
Reference in New Issue
Block a user