any way we can change the delimiter that uses grep?
I think, by default, grep uses \n as the delimiter.
|
any way we can change the delimiter that uses grep? I think, by default, grep uses | ||||
|
feedback
|
This question came from our site for professional and enthusiast programmers.
|
Unfortunately, I think because of licensing issues, there have been multiple similar projects called | |||
|
feedback
|
|
It you care just about the output,
| |||||||||||
feedback
|
|
How's this ? Any use ?
grep file "search-string" |awk 'BEGIN{RS="\n";ORS="@"}{print}'
Set '@' to whatever suits your need. | |||
|
feedback
|
$/) and awk (RS). Or you could do something likeecho "$var" | sed 's/<delimiter>/\n/' | grep <pattern>. Many many answers, depending on what your actual problem is. – Jefromi May 13 '10 at 20:38