GNU coreutils 8.28
manpages-zh
Chinese manual pages
man-pages-zh_tw
Traditional Chinese Linux man pages
coreutils
The basic file, shell and text manipulation utilities of the GNU operating system
coreutils-common
coreutils common optional components
coreutils-doc
Documentation for the GNU Core Utilities
名稱
expr - 對錶達式求值
概述
expr \,表達式\/
expr \,選項\/
expr \,選項\/
描述
--help | 顯示此幫助信息並退出 |
--version | |
顯示版本信息並退出 | |
將表達式的值打印至標準輸出。以下說明以空行分隔優先級級別,運算優先級從低到高。表達式可能爲: | |
參數1 | 參數2 | |
如果參數1 既不是 null 也不是 0,則爲參數1,否則爲參數2 | |
參數1 & 參數2 | |
如果兩個參數都不是 null 也不是 0,則爲參數1,否則爲 0 | |
參數1 < 參數2 | |
參數1 小於參數2 | |
參數1 <= 參數2 | |
參數1 小於或等於參數2 | |
參數1 = 參數2 | |
參數1 等於參數2 | |
參數1 != 參數2 | |
參數1 不等於參數2 | |
參數1 >= 參數2 | |
參數1 大於或等於參數2 | |
參數1 > 參數2 | |
參數1 大於參數2 | |
參數1 + 參數2 | |
參數1 和參數2 的代數和 | |
參數1 - 參數2 | |
參數1 和參數2 的代數差 | |
參數1 * 參數2 | |
參數1 和參數2 的代數乘積 | |
參數1 / 參數2 | |
參數1 除以參數2 的代數商 | |
參數1 % 參數2 | |
參數1 除以參數2 所得餘數 | |
字符串 : 正則表達式 | |
在字符串中由給定正則表達式決定的錨定模式匹配 | |
match 字符串 正則表達式 | |
與”字符串 : 正則表達式“相同 | |
substr 字符串 位置 長度 | |
字符串的子串,位置由 1 開始計數 | |
index 字符串 CHARS | |
任何能夠在字符串中找到的 CHARS 的位置,或者 0 | |
length 字符串 | |
字符串 的長度 | |
+ TOKEN | |
將 TOKEN 視作字符串,即使它是一個 | |
類似於 ’match’ 的關鍵字或是一個類似 ’/’ 的操作符 | |
( 表達式 ) | |
表達式 的值 |
如果 表達式 既不是 null 也不是 0,則返回狀態值爲 0;如果 表達式 是 null 或 0,則返回狀態值爲 1;如果 表達式 在語法上無效,則返回狀態值爲 1;如果發生錯誤,則返回狀態值爲 3。
作者
由 Mike Parker, James Youngman 和 Paul Eggert 編寫。
報告錯誤
GNU coreutils 的在線幫助: <http://www.gnu.org/software/coreutils/>
請向 <http://translationproject.org/team/zh_CN.html> 報告 expr 的翻譯錯誤。
請向 <http://translationproject.org/team/zh_CN.html> 報告 expr 的翻譯錯誤。
版權
Copyright © 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
參見
完整文檔請見: <http://www.gnu.org/software/coreutils/expr>
或者在本地使用: info \(aq(coreutils) expr invocation\(aq
或者在本地使用: info \(aq(coreutils) expr invocation\(aq
跋
本頁面中文版由中文 man 手冊頁計劃提供。
中文 man 手冊頁計劃:https://github.com/man-pages-zh/manpages-zh
中文 man 手冊頁計劃:https://github.com/man-pages-zh/manpages-zh