|

楼主 |
发表于 2004-6-18 09:13:09
|
显示全部楼层
最初由 dearvoid 发表
考考你: 以下结果如何解释 ?- [color=red]-(root@daisy:pts/20)-(18:15)-(~/trash/testing)-
- [4478 0] % [/color]ls
- apac1.xls europe2.xls na2.xls sa1.xls sales2.xls sam.xls
- ca1.xls na1.xls orders3.xls sales1.xls sales3.xls
- [color=red]-(root@daisy:pts/20)-(18:15)-(~/trash/testing)-
- [4478 0] % [/color]ls | grep -l [ns]a[0123456789]\.xls
- na2.xls
- sa1.xls
- [color=red]-(root@daisy:pts/20)-(18:15)-(~/trash/testing)-
- [4478 0] % [/color]
复制代码
在我这里就是不行,使用ls | grep '[ns]a[0-9]\.xls'就能选出来。
单引号究竟是什么意思??
不明白。
而且你的结果也有问题啊?少选出来一个na1.xls。这是怎么回事?
是不是加了l参数的原因,
- -l, --files-with-matches
- Suppress normal output; instead print the name of
- each input file from which output would normally
- have been printed. The scanning will stop on the
- first match.
复制代码 |
|