0

display output on one line. this is a exerpt from my kshell script

cat <filename> |egrep -v Pattern1|egrep -v Pattern2|egrep -v Pattern3 |egrep -v Pattern3
which displays
Name=john, Age=24, Occupation=Sales
Name=mike, Age=34, Occupation=Unemployed
Name=mike, Age=34, Occupation=Unemployed
Name=mike, Age=34, Occupation=Unemployed

would like to get em all on one line with or without spaces

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by eggi
0

Hey There,

Just as an aside, and not to do with the overall solution: If you use egrep, you can make use of it's extended pattern matching functionality to reduce your command line.

For instance:

egrep -v Pattern1|egrep -v Pattern2|egrep -v Pattern3 |egrep -v Pattern4

could be written as

egrep -v 'Pattern1|Pattern2|Pattern3|Pattern4'

which would match any of the for patterns, with the pipe character representing OR within the quotes.

Best wishes,

Mike

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.