Friday, August 29, 2008

Mac OS X Shell Scripting Tips For Young And Old

Hey there,

Today's post, as the title suggests, is veering slightly off the beaten path of this blog's general content. But, in keeping with this blog's tradition (and mission) of exploring all things Linux and Unix, it's not too far of a stretch. Hopefully the "Mac" in the title didn't put anyone off (Like, say "Vista," might ;). We're actually going to be looking at their underlying Linux subsystem, which is where we come full circle and it all makes sense. Mac has been fronting their BSD'ish CLI for quite a while now and, if you can use RedHat, Suse, FreeBSD or any of the other myriad varieties of Linux on the market today, OS X's insides should be easy enough for you to figure out. I'm happy, also, that Mac has a Linuxy ( Is that a word? judges? ;) command line interface. The marrying of the fancy windows interface with the bare bones power of Linux should make it easier for the next generation of computer-savvy users to not only enjoy the pretty pictures ( and the funny sounds they make when you click on them with a pointing device), but also (by necessity) possess a rudimentary knowledge of the more powerful underpinnings of all that Window dressing.

Either that or they'll be highly proficient in Fake-DOS v49.x and, if something goes horribly horribly wrong, all the jobs in the tech sector will be for BAT file programmers. I secretly wanted to be one when I started out in this business. If someone threw me enough dough, I'd still do it. Can you imagine getting paid to barely be able to do anything? ;) No offense to Windows fans out there. I, admittedly, use it to run PuTTY, Cygwin, ActiveState Perl and many other useful programs and find it to be an excellent repository for all my log files and script backups... Getting off track; sorry ;)

So, why the Mac? Yesterday, my son ( 5 years old and still kicking - literally ;) started kindergarten. I went to the orientation, because I didn't want to miss out on a milestone in my son's life just so I could catch the early train home, and - to my amazement - they actually had 3 Mac's in the classroom. Computer training (to what degree, I'm unsure) is now part of the curriculum in "kindergarten." This may come as no surprise to a lot of you, but I (being the almost-old fogy that I am) was blown away. I remember kindergarten (well, ...some of it, anyway ;) and I have hazy recollections of dealing with wooden blocks (sometimes with letters and numbers painted on the sides), stuffed animals, monkey bars, crayons, paper and absolutely nothing more "technical" than the interpretation of another person's tone of voice ;) I actually was introduced to computing in the 7th or 8th grade when our school went all out and picked up 3 or 4 TRS-80's from Radio Shack. My first program was a simple if/else clause following a question and "input prompt." My only other masterpiece was an ascii art drawing of a really long diagonal line ;)

Anyway, seeing my kid go off to school - for the first time on his own - in the big yellow bus this morning still haunts me. Not in a bad way. More of an onset of realizations that things are much different now than they were when I was young, that my kids are going to grow up and eventually move out on their own and fiercely demand their independence (even though, for now, they're still sticking like glue ;), that I'll eventually really miss the way things are now and that I waste far too much time "not" paying attention to the most important things in my life. So this little OS X crib-sheet is my way of giving my son something extra (taking time away from my work to give to my son, instead of the other way around which, although considered normal, seems increasingly counter to the development of a healthy relationship with anyone; let alone your own flesh and blood) even when I can't be there with him in person.

Here's to you, Ian. Hopefully, you'll find these tips helpful, easy to follow (hint: don't ask the "teacher" for help with these ;) and you won't use them to bring those Mac's down to whatever their equivalent of a blue-screen is ;) Either way, you'll make me proud :) I love you unconditionally and, if you just want to stop reading at this point, make sure you check out number 10 on the list below before you check out completely :)

NOTE: These links (except the last) all point back to Although I would love to (I actually do own a G4, with OS X Leopard, that's sitting in storage ;), I can't take credit for them. From what I've found tinkering around with other people's boxes, I could probably write a thing or two, based on recollection, and have it work out correctly, but - for now - I'll leave it to the folks who really know what they're doing with OS X.


My Lifted List Of Probably Fun Things To Try On An Existing OS X Macintosh (especially a public one ;)

1. Grab all the emails from an address book

2. Show all events in the Calendar's search results

3. Install the FISH shell

4. Move your cursor without moving the Zoomed-In screen

5. Create a Dock bookmark to show all Safari bookmarks

6. Become root using sudo with no password

7. Professor Fizzwizzle and the Molten Mystery - A Fun Puzzle Game

8. Easily add iTunes lyrics to songs via AppleScript

9. Create a visual catalogue of setups and dialogues

10. Send Carly (of a personal Txt Message <-- He loves that show, although he may hate me by the time he gets around to reading this ;)

, Mike

Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.