Lesson 3 Practice
For today's practice, we are going to embark on a Unix treasure hunt created by the Sanders Lab at the University of California San Francisco. Note: the treasure hunt materials can be obtained directly from the Sanders lab code repository linked above.
To begin create a directory called treasure_hunt in your class working directory and run the perl script from /data/classes/BTEP/B4B_2025/Module_1/Practice_Sessions/Practice_L4 in the treasure_hunt directory.
Solution
Read the first clue and begin.
Recommendation: Create an environment variable to store the path to the treasure hunt directory to facilitate movement through the directory.
When you have found the treasure, answer or do the following:
-
How many words are in the last line of the file containing the teasure?
-
Save the last line of
openTheBox.txtto a new file calledfinallyfinished.txtwithout copying and pasting. -
Now append the first line of
openTheBox.txtto the same file that you just saved the last line.
Congratulations! You have found the treasure and have gained some useful unix practice throughout your hunt.