Search notes:

Shell command: expr

$ expr 4 + 3
7

$ expr 4.1 + 3.2
expr: non-integer argument
Beware of the expansion of the *:
$ expr 3 * 8
expr: syntax error: unexpected argument FILENAME

$ expr '3 * 8'
3 * 8

$ expr 3 '*' 8
24
$ expr 12 / 3
4

$ expr 13 / 3
4

$ expr 12/3
12/3

See also

Using expr and date to calculate elapsed time.
test
Shell commands (such as bc) and the bash built-in let.

Links

expr on github

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Linux/sh...', 1759337664, '216.73.216.88', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Linux/shell/commands/expr(71): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78