SHELL Script IF Condition Statements

 

if..else..fi

echo "Enter the Two Values:"
Read a b
if [ $a -eq $b ]
then
echo " a is equal to b"
else
echo " a is not equal to b"
fi

if..elif..else..fi

echo "Enter the three values:"
read a b c
if [ $a -gt $b -o $a -gt $c ]; then
echo "$a is Big"
elif [ $b -gt $c ]; then
echo "$b is Big"
else
echo "$c is Big"
fi

Popular posts from this blog

Oracle Database 19C Performance Tunning - PART 1

Oracle RMAN Backup And Restore

Oracle Patching Using Opatch Utility

Welcome to DBA Master – Database Tips, Tricks, and Tutorials

Oracle 19c Database Software Installation in OEL8

PostgreSQL Triggers

PostgreSQL Opensource Installation in RHEL or Oracle Linux(OEL) 8 and above

PostgreSQL Cursor

PostgreSQL Procedures

PostgreSQL User & Role Management