Monday, March 2, 2009

Adventures in Bash Scripting

This quarter (which is thankfully two weeks away from being over) I am taking Intro to Visual Effects Programming. We spent the first half of the quarter attacking MEL Scripting, which is challenging, but somewhat understandable. The second half of the quarter we attacked Bash scripting in Linux. Bash is a lot more forgiving than MEL, but equally as hard to understand. I completed my final bash project, and I wanted to show it off a little. 

When you run the script in the command line of the terminal, a window pops up, asking the user to select a visual effects related site to launch in Firefox. The user then makes a selection of one of the radio dials, and it opens the corresponding site.

This script is rather simple, but I am proud of it anyway. Here is the actual script.

I was having a lot of trouble, and ended up hitting up the Ubuntu forums for some help. They introduced me to the zenity commands, which seem really useful for basic UI functions. I originally tried doing it with an if/then statement, since that's what I knew, but a user on the forum showed me that a case function would be much more effective.

Anyway, once I get my MEL project up and running, I will be sure to post that, since it will be much more interesting. Off to work on more finals.... woo?

1 comment: