#! /bin/bash age=60 # for using And operator role && if [ "$age" -gt 18] && ["$age" -lt xxx ] then echo "valid age" else echo "age non valid" fi # The -a selection provide # an choice chemical compound status test. if [ "$age" -gt eighteen -a "$age" -lt xxx ] then echo "valid age" else echo "age non valid" fi # if [[ $condition1 && $condition2 ]] # Also works. if [[ "$age" -gt eighteen && "$age" -lt xxx ]] then echo "valid age" else echo "age non valid" fi
Shell Scripting Tutorial For Beginners Viii - Logical 'And' Operator
Posted by Hold
on January 24, 2017
0 comments:
Post a Comment