Washington Apple Pi

A Community of Apple iPad, iPhone and Mac Users

Best of TCS

Lord of the Rings

Washington Apple Pi Journal, reprint information

As almost every Mac fan knows, the epic movie trilogy Lord of the Rings was created using Apple Shake, an advanced digital compositing package, and much of the animation was designed on Macs. Less well known is the extensive use of iPods for passing scenes back and forth between the shooting location in New Zealand and director Peter Jackson’s home in London; production crew members estimate as much as half a terabyte (500 billion bytes) of film footage were transferred using iPods.

But the connection between Lord of the Rings and Macs goes back much farther. Actually, it technically isn’t a Mac connection at all, but goes back to Mac OS X’s UNIX roots, as mentioned on these two brief TCS postings:

LC: Open up Terminal and then paste in this string:

cat /usr/share/calendar/calendar.history | grep "LOTR"

JT: The same thing, normalized/simplified:

grep LOTR /usr/share/calendar/calendar.history

Either way, kinda cute. And shows what sorts of people developed Unix. This file exists to provide a little "On this day in history..." blurb when logging into a system: "Welcome, Lawrence, you have mail, today is Charro's birthday and the anniversary of the Battle of Hastings.”

OK, so what happens if you actually try this?

Using either Mac OS X 10.2 or Mac OS X 10.3 (earlier versions weren’t available for testing), open up the Terminal application (found in Applications>>Utilities) and type in either command shown above. You should get a listing that looks like this (assuming your name is Frodo):

[hobbiton:~] frodo% grep LOTR /usr/share/calendar/calendar.history
01/05 Fellowship enters Moria (LOTR)
01/09 Fellowship reaches Lorien (LOTR)
01/17 Passing of Gandalf (LOTR)
02/07 Fellowship leaves Lorien (LOTR)
02/17 Death of Boromir (LOTR)
02/20 Meriadoc & Pippin meet Treebeard (LOTR)
02/22 Passing of King Ellesar (LOTR)
02/24 Ents destroy Isengard (LOTR)
02/26 Aragorn takes the Paths of the Dead (LOTR)
03/05 Frodo & Samwise encounter Shelob (LOTR)
03/08 Deaths of Denethor & Theoden (LOTR)
03/18 Destruction of the Ring (LOTR)
03/29 Flowering of the Mallorn (LOTR)
04/04 Gandalf visits Bilbo (LOTR)
04/17 An unexpected party (LOTR)
04/23 Crowning of King Ellesar (LOTR)
05/19 Arwen leaves Lorian to wed King Ellesar (LOTR)
06/11 Sauron attacks Osgilliath (LOTR)
06/13 Bilbo returns to Bag End (LOTR)
06/23 Wedding of Ellesar & Arwen (LOTR)
07/04 Gandalf imprisoned by Saruman (LOTR)
07/24 The ring comes to Bilbo (LOTR)
07/26 Bilbo rescued from Wargs by Eagles (LOTR)
08/03 Funeral of King Theoden (LOTR)
08/29 Saruman enters the Shire (LOTR)
09/10 Gandalf escapes from Orthanc (LOTR)
09/14 Frodo & Bilbo's birthday (LOTR)
09/15 Black riders enter the Shire (LOTR)
09/18 Frodo and company rescued by Bombadil (LOTR)
09/28 Frodo wounded at Weathertop (LOTR)
10/16 Boromir reaches Rivendell (LOTR)
10/17 Council of Elrond (LOTR)
10/25 End of War of the Ring (LOTR)
11/16 Bilbo reaches the Lonely Mountain (LOTR)
12/05 Death of Smaug (LOTR)
12/16 Fellowship begins Quest (LOTR)
[hobbiton:~] frodo%

You’ve just asked your Mac to look for the string of characters “LOTR” inside a file called calendar.history, and to print to the screen every line in the file that contains those characters.

Your Mac, sadly, doesn’t know Charro’s birthday, but it does know Isaac Asimov was born in Petrovichi, SFSR on Jan. 2, 1920, and that the Battle of Hastings took place on October 14, 1066. It even knows who won the battle.