chipper,
Serves me right for posting that at the end of my day here after coming to work with a cold. Have a star for posting a useful and non-inflamitory response
Alrighty then...
The two reasons for your grep statement outputs four lines of "****" is (1)the "-o", where it prints exactly what it matches, and it just happened to match four times in that string of asterixes, and (2)your regex (nor mine) does not specify that the fifth character must not be an asterix.
Not sure if that is even a requirement of the original, but I guess I feel like indulging in some regex masochisim today. So:
Code:
echo -e 'a\n23423\n****\n***\nfoo\n********\nkjh\n**** bar\nlog****err or\n' | grep -E '[\*]{4}[^\*]'
Will only output the lines:
while ignoring the "****" line.
I hope I have redeemed myself!
BTW: cpjust, are you by chance parsing captured output from a nortel phone switch? By an odd coincidence, "****" is the escape sequence to exit any of the maintenance programs, and go back to the main command processor (load 0)
Cheers!