样品提取的字符串值:A.TXT用grep
Reading:RG1:+ /user/reading/Monday:12
Reading:RG1:- /user/**/Friday:12
Reading:RG1:- /user/**/*.txt:12
Reading:RG1:- /user/tet/**/*.txt:12
我期待提取使用字符串
after + or - what ever the string i want it
:
cat a.txt | grep RG1|grep '+'| cut -d':' -f3| cut -d'+' -f2 |sed -e 's/ //
我越来越 /用户/阅读/星期一
但我amlooking
/用户/阅读/周一:12
我认为你接受的答案不适用于包含' - '情况的字符串。因为你只切割'+'':'only(not' - ') – Alam 2010-11-01 11:29:30
我有相同的代码 - 也..它的工作.. – Tree 2010-11-01 11:57:31