Thursday 22 December 2011

Using grep and sed

Using grep and sed

Hi everyone. I'm having trouble using these commands to their full extent. Here is my problem:

I'm dumping a log to the terminal and only want a specific set of lines that start with
Code:

V/ CONTENT ( [some number]):
But I want these lines without that junk in front of it. To display only the parts I want, I'm doing the log command piped with grep and sed

Code:

./adb logcat | grep CONTENT | sed -e 's/CONTENT ( [some number]):/ /g'
This leaves me with V/(stuff I want). I'm just not sure how to sed the V/ part out of it because in the sed command '/' symbols are used to separate fields. Anybody have an idea? :D

No comments:

Post a Comment