FACTOID # 148: The top ten tourist destinations France, Spain, USA, Italy, China, UK, Austria, Mexico, Germany and Canada account for 49.6 percent of all tourist arrivals worldwide.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Expr

expr is a command line Unix utility which evaluates an expression and outputs the corresponding value. Screenshot of a sample Bash session, taken on Linux. ... Wikibooks has more about this subject: Guide to UNIX Unix or UNIX is a computer operating system originally developed in the 1960s and 1970s by a group of AT&T Bell Labs employees including Ken Thompson, Dennis Ritchie, and Douglas McIlroy. ... Expression may refer to: (in the vernacular) the act or particular way of expressing something (including an emotion through a facial expression or configuration) (in mathematics) a mathematical expression (in computing) a programming language expression (in computing) a vector graphics software Microsoft Expression (in genetics) the effect produced by a...


Syntax: expr (expression)


expr evaluates integer or string expressions, including pattern matching regular expressions. Most of the challenge posed in writing expressions is preventing the command line shell from acting on characters intended for expr to process. A regular expression (abbreviated as regexp, regex, or regxp, with plural forms regexps, regexes, or regexen) is a string that describes or matches a set of strings, according to certain syntax rules. ...


The operators available

  • for integers: addition, subtraction, multiplication, division and modulus
  • for strings: find substring, find regular expression, find a set of characters in a string, length of string
  • for either: comparison (equal, not equal, less than, etc.)

Also, boolean expressions involving and and or, such as

 expr length "abcdef" < 5 "|" 15 - 4 ">" 8 

outputs "1". This is because length "abcdef" is 6, which is not less than (the backslash escapes a less than from the shell) 5 (so the left side of the | returns zero). But 15 minus 4 is 11 and is greater than 8, so the right side is true, which makes the or true, so 1 is the result. (The return value—the program exit status—is zero for this example.)


External links


  Results from FactBites:
 
Expr - Wikipedia, the free encyclopedia (230 words)
expr is a command line Unix utility which evaluates an expression and outputs the corresponding value.
expr evaluates integer or string expressions, including pattern matching regular expressions.
expr length "abcdef" \< 5 "" 15 - 4 ">" 8
expr (967 words)
The symbols expr, expr1, and expr2 represent expressions formed from integer and string symbols and the expression operator symbols (all separate arguments) by recursive application of the constructs described in the table.
After argument processing by the shell, expr is not required to be able to tell the difference between an operator and an operand except by the value.
The expr utility permits the integer arguments to be preceded with a unary minus.
  More results at FactBites »


 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m