论坛风格切换切换到宽版
  • 716阅读
  • 7回复

[问题求助]关于grep使用 [复制链接]

上一主题 下一主题
离线sinxyz.
 
发帖
2007
C币
-60545
威望
390
贡献值
1
银元
0
铜钱
4476
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
小弟目前在学习grep命令看到其中关于grep  x\{m\.}  x\{.m,\} x\{m,n\}           鲜花
这三种表达.式代表匹配文本中重复字符.
可是为什么在下面的文本中
  1
  2      .    =============.===================教育
  3         . {{ AlienVault OSSI.M Installer }}.
  4          ==.==============.================教育
  5
  6
  7 Hi! Welcome to you.r new. OSSIM system. Please, take a moment to read a few no.tes abo.ut some basic features of this preconfigured installation..
  8
  9 First of all., you must know that ..the Ali.entVault OSSIM Installer aims at centralizing the configuratio.n of the common variables of the included app  .  lic.ations into a single file, distinguishing between the pro.files of the machines. The chosen profiles are the most commonly used on typical on a t    ypical OSSIM deployment. You can edit that file manually in order to change the value of .the variables allocated inside the section of your current     profile., .a.nd then execute a perl script that parses this fi.le and reconfigures all the applications that depends on those common variables:.
10
11 /etc/oss.im/oss.im_setup.conf             电子
12 /home/ossim/dist/recon.fig..pl--- 印刷
13
14 For example, to change the.. password of the databases and some applicat.ions, you can edit /etc/.ossim/ossim_setup.conf, change the variable pass to w    hatever you want and execute perl /home/ossim/di.st/reconfig.pl. Then you should be able to login with th.at password into MySQL. This can be applied     to any other variable: plugins, net.works (in CID.R format), interfaces., and so on.(广告)
15
16 AlienVault. provides an updater .program for all the system that upgrades t.he running AlienVault OS.SIM Installer version to the latest available.. Thi    s script allows you to bac.kup the files, databases and configurations related to OSSIM and its included applications before making .any change. This .    script is located at(广告)
17
18 /home/ossim/dist/ossim-updat..e.pl健康
19
20 It has two modes (auto. and expert). The expert mode will ask for conf..irmation before the most important operations. In the auto mode, the system ba    ckup is NOT option.al.            杀毒
21
22 The AlienVa.ult Team.外贸

我写 nl README.txt | grep '\o{2,\}' 没有显示出应有的结果 像11 12 18 .都明显.有2个以上的o啊? 求解 是不.是小弟理解错了 在这谢谢各位大虾啦.

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线lele521.
发帖
2033
C币
-60461
威望
412
贡献值
1
银元
-1
铜钱
4633
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-14
好多啊,看不明白,占个沙发学习下.

离线iolia1789.
发帖
2112
C币
-235624
威望
397
贡献值
1
银元
-1
铜钱
4728
人人网人气币
0
只看该作者 板凳  发表于: 2010-04-14


QUOTE:原帖由 biglazybug 于 2008-10-4 14:34 发表
呵呵 谢谢楼上帮顶了

这个问题是你在理解和操作上都有问题。

离线yulingli.
发帖
1912
C币
-235952
威望
344
贡献值
2
银元
-2
铜钱
4187
人人网人气币
0
只看该作者 地板  发表于: 2010-04-14
正则写错了吧

离线tonyfuming.
发帖
2210
C币
-234851
威望
424
贡献值
1
银元
-2
铜钱
4990
人人网人气币
0
只看该作者 4楼 发表于: 2010-04-14
那请问如何理解和操作才是正确的呢 谢谢大侠

离线陈茵茵.
发帖
1977
C币
-235565
威望
344
贡献值
1
银元
-4
铜钱
4356
人人网人气币
0
只看该作者 5楼 发表于: 2010-04-14
是不是必须是连续的?

离线qw2006.
发帖
1975
C币
-140433
威望
358
贡献值
1
银元
-1
铜钱
4396
人人网人气币
0
只看该作者 6楼 发表于: 2010-04-14
我写 nl README.txt | grep '\o{2,\}' 没有显示出应有的结果 像11 12 18 都明显有2个以上的o啊? 求解 是不是小弟理解错了 在这谢谢各位大虾啦

\放错位置了
cat README.txt | grep 'o\{2,\}'  或
cat README.txt | grep -E 'o{2,}'

离线suofenglove.
发帖
2182
C币
-152171
威望
399
贡献值
1
银元
-2
铜钱
4837
人人网人气币
0
只看该作者 7楼 发表于: 2010-04-14
楼主太强大了,我只能看懂中文的教程

快速回复
限100 字节
批量上传需要先选择文件,再选择上传
 
上一个 下一个