Makefiles (solution)

by Kai Huang with cross-platform expertise from Michael Constant

This puzzle requires knowledge of UNIX/Linux command-line utilities. If nobody on your MIT Mystery Hunt team has significant experience with UNIX/Linux (extremely unlikely), we apologize.

The first step is to realize what you’re trying to do. You’re trying to reconstruct the correct versions of a few text files by running UNIX/Linux text-processing commands on the given files. The options for the commands that you’ll be running are all given, but not the command names themselves. A few of the command names are obvious from the given options, and enough of them are obvious that it should also be easy to conjecture the list is in alphabetical order by command name. For ease of reading, we first list all command names, even though some of them are only ascertained during solving.

Command Options
awk '!/! /&&NR>3'
diff
egrep '^ ?[0-9]+ ([^ ]+$|.+[A-Z])'
expand -t3
fgrep -v .
fmt -w22
fold -bsw14
head -22
iconv -c -t ascii -f ascii
nl -w2 -s' ' -bp'[[:upper:]][^[:cntrl:]]*$'
paste -d' '
sed -e's/[^a-z][^[:alnum:]]\{1,2\}//g' -e's/ $//'
sort -n
tail -23
tr '. ' ' \n'
tsort
unexpand -a
uniq -c

The solving involves examining the file contents carefully, thinking about what steps need to be taken to fix up and/or combine the given files, and finally matching those steps with the given commands/options. We’ll list the correct command lines to reconstruct the 5 correct files, in numerical order by file number.

Files f1 and f2 are processed into the list of all generic and infrastructure top-level domains.

paste -d' ' f2 f1 | \
awk '!/! /&&NR>3' | \
tsort | \
head -22

File f3 is processed into the list of amino acids that are encoded by DNA.

fold -bsw14 f3 | \
uniq -c | \
sed -e's/[^a-z][^[:alnum:]]\{1,2\}//g' -e's/ $//' | \
expand -t3

Files f4 and f5 are processed into the list of numbered MIT Courses.

diff f5 f4 | \
tr '. ' ' \n' | \
egrep '^ ?[0-9]+ ([^ ]+$|.+[A-Z])'

File f6 is processed into the list of elementary fermions (and their antiparticles).

iconv -c -t ascii -f ascii f6 | \
fmt -w22 | \
fgrep -v .

File f7 is processed into the list of Hilbert’s problems in mathematics.

unexpand -a f7 | \
nl -w2 -s' ' -bp'[[:upper:]][^[:cntrl:]]*$' | \
sort -n | \
tail -23

After correctly reconstructing the 5 files, consider the hint “wc -l *.out”. It should lead you to discover that the 5 files are lists of different consecutive lengths, 20-24. This gives an ordering for answer extraction.

Finally, consider the boxes at the bottom. Notice that the number of open boxes is equal to the number of commands. Furthermore, they’re arranged into 5 words with 3/3/4/4/4 open boxes, just as the commands are used in 5 pipelines with 3/3/4/4/4 commands. It turns out that if you take the first letters of the command names in a pipeline and put it into the open boxes of an appropriately chosen word at the bottom, then you can fill the solid box with a missing letter to form the name of a common UNIX/Linux command. The added letters in the solid boxes are the letters that will form the final answer.

The table below shows these observations in detail.

File(s)List descriptionList lengthCommandsBoxes clueBoxes answerAdded letter
f3DNA-coded amino acids20fold | uniq | sed | expandfusefuserR
f4, f5MIT Courses21diff | tr | egrepdtedateA
f1, f2Top-level domains22paste | awk | tsort | headpathpatchC
f7Hilbert's problems23unexpand | nl | sort | tailunstunsetE
f6Elementary fermions24iconv | fmt | fgrepiffdiffD

The final answer is RACED.