The conditional compares the argument with itself after a string manipulation that alters the string if it matches any character followed by any number of characters followed by an uppercase letter (equivalent to s/^..*?[A-Z]//
– ignore the ?
if you don't understand it), which would compare coLoUr
to oUr
and Colour
to Colour
. This controls for mixed case (and fails all-caps), though because it skips the first letter, it doesn't reject. It accepts i
. Yet (but neither i
nor I
are in the dictionary, see below).
If the conditional matches (there are no capitals after the first letter), unlzma
is run on the contents of the file named z
, which puts the uncompressed dictionary into standard output. grep
then queries for the argument* quietly (-q
), without regard to case—we've already controlled for casethat (-i
), and on a whole line (-x
).
*The argumentThe query is an altered a bitversion of the argument: if there isthe argument has a trailing capital I
(case sensitive!), it is removed. This is fine because I converted Because we controlled for case earlier, the only time we'd remove a capital I
would be for the word I
, in which case the grep
query seeks an empty string on its own line. The dictionary's I
entry to bewas swapped for a blank line, so it still matcheswe'll get a match.