1. R.D.SIVAKUMAR, M.Sc.,M.Phil.,M.Tech.,
Assistant Professor of Computer Science &
Assistant Professor and Head, Department of M.Com.(CA),
Ayya Nadar Janaki Ammal College,
Sivakasi – 626 124.
Mobile: 099440-42243
e-mail : sivamsccsit@gmail.com
website: www.rdsivakumar.blogspot.in
Expressions
2. Expressions
The expr and let Commands
For any individual, a day hardly ends up without doing any arithmetic calculation.
Can you imagine a world without arithmetical calculations? The answer is an
emphatic “no”. Most shells do not support numeric variables.
All variables are treated as character strings. This is possible by the use of the expr
and let commands. The expr command is used to evaluate arithmetic expressions. The
output of this command is sent to the standard output (screen).
Example:
$ let pr=5*10
echo “The product is $pr”
The product is 50
Note: The operator * (multiplication) should not be entered as *.
Note : Unlike expr , let should have variable name in the left hand side of assignment
operator.