The Direct Path to Linux UBUNTU

Chapter 5

UNIX Shell Programming


#!/bin/sh

# Purpose: To demonstrate the if-elif-else-statement between two integer values.

# This values of VALUE1 AND VALUE2 are compared and the result is displayed.

# Author: Wahid Lutfy

# CopyRight © MyWebUnivesity.com

VALUE1=5

VALUE2=10

# Find it the smaller value between 5 and 10.

# Then, display the result of the comparison.

if [ ${VALUE1} -lt ${VALUE2} ]

then

echo "The value of ${VALUE1} is smaller than the value of ${VALUE2}.";

else

echo "The value of ${VALUE2} is smaller than the value of ${VALUE1}.";

fi


Back to UNIX Shell Programming



Contact us      |      About us      |      Term of use      |       Copyright © 2000-2024 MyWebUniversity.com ™