#! /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
Shell Scripting Tutorial For Beginners Eight - Logical 'Or' Operator
Posted by Hold
on January 24, 2017
0 comments:
Post a Comment