亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 5781 | 回復(fù): 6
打印 上一主題 下一主題

[文本處理] "=~"是什么含義嗎? [復(fù)制鏈接]

論壇徽章:
22
CU大;照
日期:2013-09-18 15:22:06白羊座
日期:2014-04-14 22:56:32午馬
日期:2014-05-16 17:18:08巳蛇
日期:2014-05-30 20:53:19寅虎
日期:2014-06-03 10:53:34未羊
日期:2014-08-12 22:15:31神斗士
日期:2015-11-20 17:26:2515-16賽季CBA聯(lián)賽之浙江
日期:2016-03-15 18:27:4215-16賽季CBA聯(lián)賽之同曦
日期:2016-03-22 09:21:0115-16賽季CBA聯(lián)賽之北控
日期:2017-03-26 21:47:12技術(shù)圖書徽章
日期:2014-04-03 16:47:26摩羯座
日期:2014-03-25 23:51:36
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2014-03-12 23:11 |只看該作者 |倒序瀏覽
今天看到shell里面有這么=~符號,但是找來找去也沒找到出處(貌似在ABS里面也沒有),好像跟正則表達式有關(guān)
  1. [[ ! ${DISTRO} =~ (precise|saucy|trusty|7.0|wheezy|sid|testing|jessie|f19|f20|rhel6) ]]
復(fù)制代碼
這個符號是什么意思嗎?從哪里能夠找到最新的符號解釋文檔?

論壇徽章:
18
辰龍
日期:2014-05-21 21:01:4115-16賽季CBA聯(lián)賽之深圳
日期:2016-12-23 13:51:3815-16賽季CBA聯(lián)賽之北控
日期:2016-11-28 18:26:3815-16賽季CBA聯(lián)賽之佛山
日期:2016-11-03 11:18:5815-16賽季CBA聯(lián)賽之遼寧
日期:2016-07-10 16:09:4115-16賽季CBA聯(lián)賽之江蘇
日期:2016-02-20 23:09:202015亞冠之塔什干棉農(nóng)
日期:2015-08-17 19:49:492015年亞洲杯之日本
日期:2015-04-30 01:24:342015年亞洲杯之約旦
日期:2015-04-01 00:37:182015年亞洲杯之沙特阿拉伯
日期:2015-03-02 15:55:40處女座
日期:2014-05-25 10:34:0020周年集字徽章-年
日期:2023-04-23 11:17:52
2 [報告]
發(fā)表于 2014-03-13 01:15 |只看該作者
[[ ! ${DISTRO} =~ (precise|saucy|trusty|7.0|wheezy|sid|testing|jessie|f19|f20|rhel6) ]]
字符串$DISTRO中不含有precise|saucy|trusty|7.0|wheezy|sid|testing|jessie|f19|f20|rhel6這11個字符串中的任何一個

論壇徽章:
15
2015年辭舊歲徽章
日期:2015-03-03 16:54:15雙魚座
日期:2015-01-15 17:29:44午馬
日期:2015-01-06 17:06:51子鼠
日期:2014-11-24 10:11:13寅虎
日期:2014-08-18 07:10:55酉雞
日期:2014-04-02 12:24:51雙子座
日期:2014-04-02 12:19:44天秤座
日期:2014-03-17 11:43:36亥豬
日期:2014-03-13 08:13:51未羊
日期:2014-03-11 12:42:03白羊座
日期:2013-11-20 10:15:18CU大;照
日期:2013-04-17 11:48:45
3 [報告]
發(fā)表于 2014-03-13 08:09 |只看該作者
這個是具體解釋:
  1. An additional binary operator, ‘=~’, is available, with the same precedence as ‘==’ and ‘!=’. When it is used, the string to the right of the operator is considered an extended regular expression and matched accordingly (as in regex3)). The return value is 0 if the string matches the pattern, and 1 otherwise. If the regular expression is syntactically incorrect, the conditional expression’s return value is 2. If the shell option nocasematch (see the description of shopt in The Shopt Builtin) is enabled, the match is performed without regard to the case of alphabetic characters. Any part of the pattern may be quoted to force it to be matched as a string. Substrings matched by parenthesized subexpressions within the regular expression are saved in the array variable BASH_REMATCH. The element of BASH_REMATCH with index 0 is the portion of the string matching the entire regular expression. The element of BASH_REMATCH with index n is the portion of the string matching the nth parenthesized subexpression.
復(fù)制代碼
如果你看過我的另一個帖子的話,就對=~ 不會陌生了。

http://72891.cn/thread-4125147-1-1.html

論壇徽章:
93
2015年辭舊歲徽章
日期:2019-10-10 10:51:15CU大;照
日期:2014-02-21 14:21:56CU十二周年紀念徽章
日期:2020-10-15 16:55:55CU大;照
日期:2014-02-21 14:22:07羊年新春福章
日期:2019-10-10 10:51:39CU大牛徽章
日期:2019-10-10 10:55:38季節(jié)之章:春
日期:2020-10-15 16:57:40ChinaUnix元老
日期:2019-10-10 10:54:42季節(jié)之章:冬
日期:2019-10-10 10:57:17CU大;照
日期:2014-02-21 14:22:52CU大;照
日期:2014-03-13 10:40:30CU大牛徽章
日期:2014-02-21 14:23:15
4 [報告]
發(fā)表于 2014-03-13 09:12 |只看該作者
它是bash內(nèi)建測試命令的操作符,所以要在bash man里找:
man bash:
  1.        [[ expression ]]
  2.               Return a status of 0 or 1 depending on the evaluation of the conditional expression expression.  Expres-
  3.               sions are composed of the primaries described below under CONDITIONAL EXPRESSIONS.  Word  splitting  and
  4.               pathname  expansion are not performed on the words between the [[ and ]]; tilde expansion, parameter and
  5.               variable expansion, arithmetic expansion, command substitution, process substitution, and quote  removal
  6.               are performed.  Conditional operators such as -f must be unquoted to be recognized as primaries.

  7.               When used with [[, The < and > operators sort lexicographically using the current locale.

  8.               When  the  == and != operators are used, the string to the right of the operator is considered a pattern
  9.               and matched according to the rules described below under Pattern Matching.  If the shell option  nocase-
  10.               match  is  enabled,  the  match  is  performed without regard to the case of alphabetic characters.  The
  11.               return value is 0 if the string matches (==) or does not match (!=) the pattern, and 1  otherwise.   Any
  12.               part of the pattern may be quoted to force it to be matched as a string.

  13.               An  additional  binary  operator,  =~,  is available, with the same precedence as == and !=.  When it is
  14.               used, the string to the right of the operator is considered an extended regular expression  and  matched
  15.               accordingly (as in regex(3)).  The return value is 0 if the string matches the pattern, and 1 otherwise.
  16.               If the regular expression is syntactically incorrect, the conditional expression鈥檚 return  value  is  2.
  17.               If  the shell option nocasematch is enabled, the match is performed without regard to the case of alpha-
  18.               betic characters.  Any part of the pattern may be quoted to force it to be matched as  a  string.   Sub-
  19.               strings  matched  by  parenthesized  subexpressions within the regular expression are saved in the array
  20.               variable BASH_REMATCH.  The element of BASH_REMATCH with index 0 is the portion of the  string  matching
  21.               the  entire  regular  expression.  The element of BASH_REMATCH with index n is the portion of the string
  22.               matching the nth parenthesized subexpression.
復(fù)制代碼

論壇徽章:
22
CU大;照
日期:2013-09-18 15:22:06白羊座
日期:2014-04-14 22:56:32午馬
日期:2014-05-16 17:18:08巳蛇
日期:2014-05-30 20:53:19寅虎
日期:2014-06-03 10:53:34未羊
日期:2014-08-12 22:15:31神斗士
日期:2015-11-20 17:26:2515-16賽季CBA聯(lián)賽之浙江
日期:2016-03-15 18:27:4215-16賽季CBA聯(lián)賽之同曦
日期:2016-03-22 09:21:0115-16賽季CBA聯(lián)賽之北控
日期:2017-03-26 21:47:12技術(shù)圖書徽章
日期:2014-04-03 16:47:26摩羯座
日期:2014-03-25 23:51:36
5 [報告]
發(fā)表于 2014-03-13 09:39 |只看該作者
@bikkuri
@rdcwayx
@seesea2517

謝謝三位大神指點~,已經(jīng)明白了。
找了很多資料都沒找到,還是CU多大神

論壇徽章:
145
技術(shù)圖書徽章
日期:2013-10-01 15:32:13戌狗
日期:2013-10-25 13:31:35金牛座
日期:2013-11-04 16:22:07子鼠
日期:2013-11-18 18:48:57白羊座
日期:2013-11-29 10:09:11獅子座
日期:2013-12-12 09:57:42白羊座
日期:2013-12-24 16:24:46辰龍
日期:2014-01-08 15:26:12技術(shù)圖書徽章
日期:2014-01-17 13:24:40巳蛇
日期:2014-02-18 14:32:59未羊
日期:2014-02-20 14:12:13白羊座
日期:2014-02-26 12:06:59
6 [報告]
發(fā)表于 2014-03-13 10:14 |只看該作者
本帖最后由 jason680 于 2014-03-13 10:20 編輯

回復(fù) 5# GB_juno

study basic shell skill in top of this forum


http://72891.cn/forum-24-1.html

Shell版新手導(dǎo)航    Shell基礎(chǔ)二十篇    Shell十三問    Shell綜合水平測試    Linux相關(guān)書籍    Shell版精華帖合集    Shell索引樹


Linux相關(guān)書籍  http://72891.cn/thread-1776727-1-1.html
(中文版)  ABS_Guide_cn.pdf(pdf格式).tar.bz2
  
  ...
  =~ 用于正則表達式,這個操作將在正則表達式匹配部分講解,只有version3 才支持.
  ...
  =~ 正則表達式(Regular Expression) 匹配操作符在雙方括號(double brackets)
測試表達式中使用. (Perl 也有一個相似的操作符.)
   

英文版(6.2):
Advanced Bash-Scripting Guide_6.2.pdf

=~
regular expression match. This operator was introduced with version 3 of Bash.

論壇徽章:
22
CU大;照
日期:2013-09-18 15:22:06白羊座
日期:2014-04-14 22:56:32午馬
日期:2014-05-16 17:18:08巳蛇
日期:2014-05-30 20:53:19寅虎
日期:2014-06-03 10:53:34未羊
日期:2014-08-12 22:15:31神斗士
日期:2015-11-20 17:26:2515-16賽季CBA聯(lián)賽之浙江
日期:2016-03-15 18:27:4215-16賽季CBA聯(lián)賽之同曦
日期:2016-03-22 09:21:0115-16賽季CBA聯(lián)賽之北控
日期:2017-03-26 21:47:12技術(shù)圖書徽章
日期:2014-04-03 16:47:26摩羯座
日期:2014-03-25 23:51:36
7 [報告]
發(fā)表于 2014-03-13 10:20 |只看該作者
@jason680
謝謝,之前在ABS里面沒有看到后面37章..慚愧
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP