expr is a shell command that evaluates an expression and outputs the result. It evaluates integer or string expressions, including pattern matching regular expressions. Comparison operators (equal, not equal, less than, etc.) apply to both integer and string values. Integer-specific operations include addition, subtraction, multiplication, division and modulus. String-specific operators include: matching a regular expression (, or the colon syntax for an arbitrary string "str" and regular expression "reg") finding a set of characters in a string () finding a substring () finding the length
via Wikipedia infobox
exprは、Unixのコマンドの一つで、引数として与えられた数式を評価し、結果を標準出力に書き出す。Version 7 Unixより追加された。 exprは整数や文字列の数式(正規表現によるパターンマッチングを含む)を評価する。exprでは以下の操作ができる。 * 整数: 加算、減算、乗算、除算、剰余 * 文字列: 文字列の中から正規表現にマッチする部分を探す、文字列の中から文字を探す、部分文字列を探す、文字列長を求める * 両方: 比較(等しい、等しくない、大きいなど)。真は1、偽は0。 以下は、を計算している例である。 expr length "abcdef" "<" 5 "|" 15 - 4 ">" 8 上記を実行すると"1"が出力される。まず、「length "abcdef"」が 6 になり、「6 "<" 5」は正しくないので、"|"の左側は 0 となる。「15 - 4」は 11 で、「11 ">" 8」は正しいので、"|"の右側は 1 となる。全体で「0 "|" 1」(0または1)となり、結果は 1 である。正常終了時は、終了ステータスは 0 になる。 数値のみの計算をする場合は、bcを使用した方が便利である。 部分文字列を探す機能と文字列長を求める機能は一部のバージョンのみが対応しており、移植性の観点からは使用は勧められない。
Abstract from DBpedia / Wikipedia · CC BY-SA
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).
via Wikidata sitelinks · CC0