Operators

Various operations can be performed on the data within your shell scripts, falling under the following categories:

  • Arithmetic Operators
  • Relational Operators
  • Boolean (/Logical) Operators
  • Bitwise Operators
  • String Operators
  • File Test Operators

 

Further, there are a number of methods that can be carried out to perform these operations:

  • Arithmetic Expansion
    • echo $(( 6 * 7 ))
  • expr
    • expr 6 + 7
  • let
    • let "a = 6 * 7"; echo $a
  • bc
    • echo "6*7" | bc