Not only tar. Not so long ago,
DistroWatch Weekly ran
an article in their
Tips and Tricks column describing how to find the right words with grep. You know, sort of the task
danielbmartin sometimes posts here.
So, I set out to compare how different grep-like (and not-so-like) tools fare against each other doing this task.
First, I tried something like
Code:
time sh -c "grep -P '(?=.*a)(?=.*e)(?=.*i)(?=.*o).*u' /usr/share/dict/words>/dev/null"
But quickly noticed that some tools did it suspiciously fast, and so I ended up piping the output to
wc to get reasonable results.
Code:
time sh -c "grep -P '(?=.*a)(?=.*e)(?=.*i)(?=.*o).*u' /usr/share/dict/words|wc -l"
I guess those grep-like tools stop the search after the first successful match when redirected to /dev/null.
I uploaded the full script
here if anybody is interested.