Technology news and Jobs
The Linux distillery
A Linux Christmas Carol explained
The Linux distillery
A Linux Christmas Carol explained | A Linux Christmas Carol explained |
|
| by David M Williams | |
| Sunday, 28 December 2008 | |
|
Page 1 of 3
On Christmas Eve I suggested what "Jingle Bells" may look like if it were a Linux shell script. Here it is for those who missed out, and some interpretation for those who didn't.
Featured Whitepaper
5 Best Practices for Smartphone Support
So, here’s a bit of a helping hand – especially for my Windows’ friends who may not be so familiar with a command line. First, you can find the original Jingle Bells shell script here. Let’s break it down. I started off a bit lame – sorry. For “Dashing through the snow” I invoked the Linux command “time.” This takes as a parameter another command and measures how long it takes to execute – both in terms of real time and CPU time. % time snow is thus meant to express the timing of a fictitious command called ‘snow’ – now, being performance junkies, we want snow to run swiftly. You might even say we want its execution to dash through! Next, as you know, we must go over fields in a one horse open sleigh. With sleight of hand I’m invoking another fictitious command called ‘OneHorseOpenSleigh’ but this time when we run it we’ll send the output to a text file called fields. The > symbol, when used on the command line, will redirect output from the screen to the named file. This is true also of the Microsoft Windows command line. % OneHorseOpenSleigh > fields Our mode of transportation is such great fun that we’re laughing all the way. Of course, in today’s contemporary jargon you might say we’re “lol”’ing ... or “laughing out loud.” (As an aside, do people really roll around on the floor laughing at the simplest things? I’m more of a CSAK – “chuckling silently at keyboard” – person, myself.) I could have used % echo lol to effectively print “lol” on the screen. However, does that really represent the magnitude of our laughter and merriment as embodied in Jingle Bells? No, something much louder and magnificent is needed here. And Linux has just the thing for the job! CONTINUED |
| < Next story in category | Previous story in the category > |
|---|











