Scripting Projects - The power of the Mac Terminal

Examples of the use of the Bourne Shell, Awk, Sed, Imagemagick and other favoured command line tools

I settled on the Mac because it gives me the best balance between the raw gloves-off computing capabilities of Linux (sorely lacking in Windows), at the same time as the multimedia handling capabilities of Windows (sorely lacking in Linux, at least until Ubuntu started sorting things out)

Project One thing about the mac is a full, unix-like Terminal which enables you to drop into command line manipulation of files and serial ports and usb drivers and what not. If you don't know what the command line is, then you're living the computing equivalent of a life in cotton wool. Warm and comfy no doubt, but impossible to get around, hard to get anything done, and always coughing up hairballs. The command line is your friend.

Managing all the different command line tools you need is easy using a Mac-specific version of the debian package management tools, called Fink. Another tool, based on the 'port' approach to package management is called Darwinports. These can help to make sure when you need imagemagick or wget or something similar, then you can just type something like... fink install imagemagick ...at the command line, and the rest will be done for you, whammo!

Here are some examples of the projects I've been using this set of command line techniques for on the mac...

  • To eliminate the frequent duplicate tracks found in iTunes Libraries (I've encountered anything up to 22 duplicates at times, I wrote a set of scripts in Bash and Awk
  • I turned old photographic plates from Muybridge into gif animations and zoetropes with a combination of arithmetic in Bash and image slicing operations from Image Magick. This combines material from practically the first motion photographer, with modern open source image manipulation techniques.
  • Katyapopova.com was entirely built using Bash, Cat and Awk, which reads a few text files containing client and project data, and then writes out html files generated from a set of small html fragments. This was before I discovered XSLT

This is on top of plenty of maintenance scripts for Hubbub, and to generate Branded website elements for the BT Labs website

Tagged:

scripting (6)

bash (3)

imagemagick (2)

awk

katyapopova.com