Skip to Main Content
Linux Shell Scripting Essentials
book

Linux Shell Scripting Essentials

by Sinny Kumari
November 2015
Beginner content levelBeginner
282 pages
5h 5m
English
Packt Publishing
Content preview from Linux Shell Scripting Essentials

Operators

Similar to other programming languages, shell programming also supports various types of operators to perform tasks. Operators can be categorized as follows:

  • Assignment operator
  • Arithmetic operators
  • Logical operators
  • Comparison operators

The assignment operator

Equal to an operator (=) is the assignment operator that is used to initialize or change the value of a variable. This operator works on any data such as a string, integer, float, array, and so on. For example:

$ var=40           # Initializing variable var to integer value
$ var="Hello"    # Changing value of var to string value
$ var=8.9        # Changing value of var to float value

Arithmetic operators

Arithmetic operators are used for doing arithmetic operations on integers. They are as follows:

  • + (plus) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Linux Shell Scripting

Learning Linux Shell Scripting

Ganesh Sanjiv Naik

Publisher Resources

ISBN: 9781785284441Supplemental Content