Here is my problem: Any number of lines of text is given from standard input. Output: number of non repeating lines
INPUT:
She is wearing black shoes.
My name is Johny.
I hate mondays.
My name is Johny.
I don't understand you.
She is wearing black shoes.
OUTPUT:
2
Here's how I'd solve the problem:
But that's pretty opaque. Here's a (slightly) more legible way to look at it (requires bash version 4)
You could try using uniq
man uniq
and do the following