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
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
V/ CONTENT ( [some number]):
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
./adb logcat | grep CONTENT | sed -e 's/CONTENT ( [some number]):/ /g'
My knowledge of sed is shorter than it's name, so this is a bit of a guess... Have you tried escaping the '/' character in the string (ie put a '\' before the '/')?
Worked perfectly. Cheers to you my man (or woman).
What a great guess! Glad it worked, and I'm very much a bloke. To prove it I'd graciously accept a beer.
Originally Posted by vjd5023