Home » » Shell Scripting Tutorial For Beginners Eight - Logical 'Or' Operator

Shell Scripting Tutorial For Beginners Eight - Logical 'Or' Operator



#! /bin/bash  age=60  # for using OR operator purpose || if [ "$age" -gt 18] || ["$age" -lt xxx ] then   echo "valid age"   else   echo "age non valid" fi  #  The -o selection provide # an option chemical compound status test. if [ "$age" -gt xviii -o "$age" -lt xxx ] then   echo "valid age"   else   echo "age non valid" fi  # if [[ $condition1 || $condition2 ]]    # Also works. if [[ "$age" -gt xviii || "$age" -lt xxx ]] then   echo "valid age"   else   echo "age non valid" fi 

0 comments:

Post a Comment

Search

Blog Archive