Jan 13, '04 10:53:00AM • Contributed by: evildrbob
cat /usr/share/calendar/calendar.history | grep "LOTR"Timely and fun, imho. :)
|
|
|
View a Lord of the Rings timeline easter egg in calendar
Jan 13, '04 10:53:00AM • Contributed by: evildrbob
Just for fun ... Lord of the Rings (LotR) is quite the story and now quite a cinematic experience as well. Seems at least one of the those that contributed to the BSD Unix
kernel OS X utilizes thought so too. To see the LotR event timeline built
into OS X, do this: Open the Terminal (in your Applications -> Utilities folder). Copy and paste the following, then hit enter at the terminal prompt:
cat /usr/share/calendar/calendar.history | grep "LOTR"Timely and fun, imho. :)
•
[36,914 views]
Hint Options
View a Lord of the Rings timeline easter egg in calendar
It's there in Debian Linux, too.
View a Lord of the Rings timeline easter egg in calendar
The events are in my Debian as well, but the (LOTR) isn't in there. So I can grep on Frodo but not LOTR.
View a Lord of the Rings timeline easter egg in calendar
I wonder how far back this goes. This is a typical geeky thing, and I bet it goes back into the 70's. You know, I bet by seeing which versions of *nixes have it and which don't you could pretty precisely figure out the date based on when the branch of the tree that has it split off from the others. Now I just need a login into some more flavors of UNIX machines. Anyone wanna try Solaris?
View a Lord of the Rings timeline easter egg in calendar
P.S.
View a Lord of the Rings timeline easter egg in calendar
That's what we call in the business a Useless Use of Cat. Perhaps to speed up both your fingers and your computer, you could have typed that as:
Almost every use of "cat SINGLEFILE | ...somecommand..." is wrong. Learn!
View a Lord of the Rings timeline easter egg in calendar
How about
View a Lord of the Rings timeline easter egg in calendar
cpio < somefile
View a Lord of the Rings timeline easter egg in calendar
Almost every use of "cat SINGLEFILE | ...somecommand..." is wrong. Learn!
If anybody was wondering why UNIX hasn't taken over the world, there you go. There is absolutely nothing wrong about this use of cat. No, it's not necessary, but it works just fine. In this particular instance, it's my preferred idiom for searching a single file, because I can't reliable remember whether grep's command-line syntax is "grep pattern file" or "grep file pattern." In other words, I can't remember whether to think "search for this in that" or "search that for this." With cat and a pipe, I don't have to. UNIX is great. UNIX is fantastic. People who look at a perfectly good way of doing something with UNIX and fly off the handle, call it wrong, and command those who use it to "Learn!" kinda suck, however.
View a Lord of the Rings timeline easter egg in calendar
I can't reliable remember whether grep's command-line syntax is "grep pattern file" or "grep file pattern."
Here's a way that I remember. Grep searches multiple files for one pattern. That means that you specify the pattern first, then a bunch of files. "grep pat *" searches all files for the pattern "pat". With this in mind, it's relatively easily to reminder, since "grep * pat" is simply never seen. Don't know if this helps, but it works for me. ---
View a Lord of the Rings timeline easter egg in calendar
Define Wrong. Did it Work? Yes. That's the beauty of UNIX, so many ways to get the job done. Consider that maybe he didn't know what he was grepping for in the first place. He 'cat's the file, then sees the "LOTR" string, hits up arrow, and tags his '| grep' command at the end of his previous command. Anyhow... who cares. Get off your high horse.
View a Lord of the Rings timeline easter egg in calendar
You're right in that it is unnecessary to use 'cat' in many cases. If I were writing a shell script I would be very scrutinous of the excessive usage of 'cat' or 'grep' or 'awk' (or any other tool) especially in a loop. With experience comes a more evolved usage of the command line.
View a Lord of the Rings timeline easter egg in calendar
Another perfectly valid reason to use cat foo | grep is when you need an alias for quickly getting information out of a log. For example, I have several aliases (I use the AT&T ksh for my shell) that look like:
alias gethist 'cat /var/log/foo.log | grep'This allows me to type only gethist dude to grep 'dude' out of the foo.log log. Saves typing the log path out...Another use is for looking into files that I do not have read permission on (I'm a user consultant here at work and frequently need to look at user and/or system files). Since I do not have sudo (e.g. root) access to the grep command, I often wind up doing sudo cat /root/owned/file | grep foo. This way only cat has to run as root.
View a Lord of the Rings timeline easter egg in calendar
alias gethist 'grep \!^ /var/log/foo.log' would do the same, but optimized.
View a Lord of the Rings timeline easter egg in calendar
Try
. I forgot the backslash away in my first post..
View a Lord of the Rings timeline easter egg in calendar
cat file | grep "word"
View a Lord of the Rings timeline easter egg in calendar
For those who would like to possibly expand upon this, you can install the perl module
"Date::Tolkien::Shire" and get programmatic access to the historical Middle Earth timeline for any given date.
perl.com has an article that shows usage, and you can add it to the local perl library by opening up a terminal and entering: If you've never done a module install from CPAN before, you might want to do a: first to setup CPAN access. It's fun to add it to login profiles, web pages and mail signatures. ---
Errors in LOTR Timeline
This hint shows that the destruction of the Ring occurred:
03/18 Destruction of the Ring (LOTR) but in fact it occurred on March 25th. Lee Joramo
Errors in LOTR Timeline
Well, there are differences between "Shire Reckoning" and the modern calendar (which is discussed at great length in Appendix D of the trilogy). Basically, all their months were 30 days long and extra holidays were added at various points of the year to fill out the calendar. Moreover, the year did not start at the same point as ours. According to the appendix "our New Year's Day corresponded more or less to the Shire January 9."
Complete LOTR Chronology
Egads, I hope the Tolkien estate doesn't get wind of this, start acting like SCO about Linux, and file a copyright infringement lawsuit against this innocent bit of fun. I spent almost a year in Seattle's federal court fighting their absurd claim that only they can publish a chronology or other reference to LOTR. Faced with the distinct possibility of losing at the summary judgment stage, they settled out-of-court last spring.
If you're interested, Untangling Tolkien, the first book-length (251 page) chronology of LOTR, is out and selling on Amazon.com and elsewhere. You can get more details at http://www.inklingbooks.com/ If someone would like to create useful software with a LOTR theme, I'd be happy to agree to the use of material from the book. Just contact me through the website above. One person has floated the idea for a Shire calendar. If you live near Seattle, you can hear Gimli/John Rhys-Davis speak this Saturday. (Details at www.discovery.org). I'll be at a table signing copies of the book. Good thing I was asked. The tickets are a bit pricey ($30) for my budget. --Mike Perry
View a Lord of the Rings timeline easter egg in calendar
They thoroughly misspelled King Elessar's name, though. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.24 seconds |
|