Operators in Unix

Prev     Next

Operators in UNIX :

Operators in UNIX: -eq operator is used to check whether variable 1 and variable 2 are equal

Ex:

  • if [ variable1 -eq variable2 ]
  • -ne operator – To check whether variable 1 and variable 2 are not eqal.

Ex:

  • if [ variable1 -ne variable2 ]
  • -lt operator – To check whether variable 1 is less than variable 2.

Ex:

  • if [ variable1 -lt variable2 ]
  • -le operator – To check whether variable 1 is less than or equal to variable 2.

Ex:

  • if [ variable1 -le variable2 ]
  • -gt operator – To check whether variable 1 is greater than variable 2.

Ex:

  • if [ variable1 -gt variable2 ]
  • -ge operator – To check whether variable 1 is greater than or equal to variable 2.

Ex:

  • if [ variable1 -ge variable2 ]

    Prev     Next

Share this website !!!
Facebook Twitter Linkedin