The expr command is a handy utility for evaluating constants and strings via the command line interface. Here are a few examples of expressions.
# expr 9 \* 9
81
# expr 9 / 9
1
# expr 9 + 9
18
# expr 9 - 9
0
# expr 9 % 9
0
# expr 50 - 100
-50
# expr 6 + 8 \* 9
78
# expr 9 \* \( 2 + 6 \)
72
Evaluate relational operators: true (1) or false (0)
# expr aaa \< myblog
1
# expr aaa \> myblog
0
# expr aaa == myblog
0
# expr aaa != myblog
1
# expr 8 \<> 9
0
# expr 8 != 9
1
# expr 8 \<= 9
1
This blog covers Unix system administration HOWTO tips for using inline for loops, find command, Unix scripting, configuration, SQL, various Unix-based tools, and command line interface syntax. The Unix OS supports tasks such as running hardware, device drivers, peripherals and third party applications. Share tips/comments. Read the comments. But most importantly: Read Disclaimer - Read Disclaimer.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment