- 论坛徽章:
- 0
|
看着网中人先生的文章,觉得受益不少,不过这里,好象版本号为2.5.1的grep与2.4.2
的grep在精确查找上面有些差别
2.4.2在精确查找的时候,好象都是这样:
2.5.1的则是这样:
相差一个分号──“;”
下面是我的测试shell与输出结果
- guokai@superworker:~/temp$ echo "48" | grep '\<48\>'
- 48
- guokai@superworker:~/temp$ echo "48" | grep "\<48\>"
- 48
- guokai@superworker:~/temp$ echo "483" | grep "\<48\>"
- guokai@superworker:~/temp$ echo "483" | grep '\<48\>'
- guokai@superworker:~/temp$ grep --version
- grep (GNU grep) 2.5.1
- Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
- This is free software; see the source for copying conditions. There is NO
- warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
复制代码
[ 本帖最后由 caesar1985 于 2006-2-5 19:56 编辑 ] |
|