Sometimes you just have to write a program.

I'm a UNIX pipe enthusiast.

Well, that came out a little more bong-like than intended.

What I mean to say is that, when I have a computer problem to solve, I prefer to solve it using ready-made little programs that are then strung together to do the job. The metaphorical string is the UNIX pipe operator -- the vertical bar thingy on your keyboard that looks like this: | -- which simply takes the output of one program and makes it the input to the next.

It sounds simple. It is simple. And yet it can do astounding things. All without having to write a program, in the traditional sense.

The other day I strung together a doozy of a command necklace to download the web pages for a course at the College, strip out the navigation links, simplify the HTML code, and then package the whole megillah into a format that could be loaded into the College's learning management system.

For a number of reasons, not the least of which my hubris, it didn't really work all that well.

So, after the requisite fruitless twiddling-of-the-command-switches exercise, I threw out the idea and began writing it all out again as a program, written in Python this time around. I like Python.

There's no life lesson in any of this, told by way of pipe analogies. No particular computer programming lesson either.

Sometimes you can take a big problem and break it into simple, easily digestible chunks, and solve it with off-the-shelf utilities. Sometimes you just have to write a program.

Archived Comments

  1. Alan Stewart on 20120509.Wednesday:
    I know what you mean. Quite some time ago when I was doing early Java cell phone development, I needed a way to capture the emulator screen so that I could make an animated .GIF file from it. I spent three days looking for a good solution only to finally decide to spend a few hours making my own from Java's Robot class. Sometimes you just have to roll your own because you are the only one who knows exactly what you need.
  2. Dave on 20120510.Thursday:
    Especially when you have such specific and unusual needs. Actually, strike that: all needs are specific and unusual if they're not already being met.