grep 多字符查找问题
-
- 帖子: 9
- 注册时间: 2014-03-08 17:38
- millenniumdark
- 论坛版主
- 帖子: 4159
- 注册时间: 2005-07-02 14:41
- 系统: Ubuntu 14.04 (Kylin)
- 联系:
-
- 帖子: 53
- 注册时间: 2010-12-09 23:54
Re: grep 多字符查找问题
代码: 全选
[test]$ cat test.txt
a
b
c
[test]$ cat string.txt
a
[test]$ cat seed.sh
while read string
do
echo "grep $string"
grep "$string" test.txt
done <string.txt
[test]$ sh seed.sh
grep a
a
-
- 帖子: 136
- 注册时间: 2012-03-28 10:16
Re: grep 多字符查找问题
楼主把grep命令用错了吧
应该是
echo $string |grep -w -e '*.log'
楼主的意思是从string里面找log结尾的东西对吗?
应该是
echo $string |grep -w -e '*.log'
楼主的意思是从string里面找log结尾的东西对吗?