Menu Search
Home
Oracle Cloud Cookbook
Sign-in
|
Join
Home
AND and OR operations in shell script
Thanks to
Sandeep
for this story
Jun 17, 2012 9:55pm
Linux
And, OR operation in shell script called as compound comparisons.
“
-a
” stands for logical AND operator,
“
-o
” stands for logical OR operator.
Usage/Example:
For AND
if [ $expr1 -a $expr2 ]
For OR
if [ $expr1 -o $expr2 ]
-Sany
Read the entire article at its source
Feed: Sandeep
Original article