Quote:
Originally Posted by
RudiC
Why should grep s try to match an S ? And, recheck your conclusions (what does and when applies the || ?).
Just making sure we're not talking past each other here. The file names are all supposed to be lower case. So
grep s is only looking for a lower case "s".
|| Now I see, I believe switched that up. You only reach the right side, when the left side is false.
So to summarize
1. I'm kinda at a loss here. The answer is probably super simple, but I just don't get it. Could it be only 1 time. Since we don't reach that part anymore because there's no loop for it?
2. 15 times.
3. 8 times, since we only reach
grep r, when there's no "s" in a file name.
4. 2 times, since there are only 2 items with neither "s" or "r"
5. 1 time.
EDIT: WAIT, now I get it.
1. 16 times. Since we have 15 files and then another time for the EoF.
2. 15 times. Because we have to check every single one for an "s"
3. 8 times. Since
grep s is false 8 times.
4. 2 times. Since that's the amount of items with neither an "s" nor an "r".
5. 1 time.