Notations to check conditions
- The comparison of string or numeric is the main decision taken to check for certain condition.
- The comparison like equal to, not equal, less than, greater than, less than or equal, greater than or equal, etc
- These can also be represented in bash as
- equal to : -eq
- not equal : -ne
- greater than : -gt
- less than : - lt
- greater or equal : -ge
- less or equal : -le
- These will help greatly when using loops.
- The way of using these format in conditional statement are similar to https://cybercheck123.blogspot.com/2022/05/bash-scripting-6.html
- The only change is to replace these notation instead of symbols.
- Examples :
- Example to check greater of three number:
No comments:
Post a Comment