Shell Scripting

Finishing Up the Content Spinner

You'll recall that in my last article I shared a long, complex explanation for why spam email catches my attention and intrigues me, perhaps more than it should. Part of it is that I've been involved in email forever—I even wrote one of the most popular old-school email programs back in the day.

The Many Paths to a Solution

A project I'm involved with has made me think about how there are always many solution paths for any given problem in the Linux universe. For this other project, I wanted to cobble together a version of grep that let me specify proper regular expressions without having to worry about the -E flag and get a context for the matches too.

All about printf

In my last article, "Fancy Tricks for Changing Numberic Base", I explored the surprising ability of the Linux shell to convert numeric bases on the fly, including this sweet little snippet that converts FF hexadecimal into decimal notation: $ echo $(( 0xFF )) 255

Working with Command Arguments

In this article, I want to cover a more fundamental aspect of shell scripting: working with command arguments. I suspect that most shell scripts go through an evolution with their command flags, a

Bash Shell Script: Building Your March Madness Bracket

I must admit that I don't really follow basketball. But, I do like to engage with folks at work, and every spring I've always felt a little left out when my work colleagues fill out their NCAA March Madness basketball brackets. If your office is like mine, it seems everyone gets very excited to build their brackets and follow the basketball games and play in an office pool.

Working with Functions: Towers of Hanoi

For this article, I thought it would be beneficial to go back to some basics of shell scripting and look at how functions work. Most script writers probably eschew using functions because it's a bit antithetical to how scripts tend to evolve, as a sequence of commands on the command line that are captured in a file.

Picking Out the Nouns

A reader wrote a letter to me (oh happy day!), and although I'm still not entirely sure what she's trying to accomplish, it's an interesting puzzle to try to tackle anyway. Here's what she asked:

Days Between Dates: the Counting

In my last article, we began an exploration of date math by validating a given date specified by the user, then explored how GNU date offers some slick math capabilities, but has some inherent limitations, the most notable of which is that it isn't on 100% of all Linux and UNIX systems.

Easy Watermarking with ImageMagick

Let's start with some homework. Go to Google (or Bing) and search for "privacy is dead, get over it". I first heard this from Bill Joy, cofounder of Sun Microsystems, but it's attributed to a number of tech folk, and there's an element of truth to it. Put something on-line and it's in the wild, however much you'd prefer to keep it under control.

Resizing Images with ImageMagick

Sure, you can open up a graphics program like GIMP and resize an image, but what if you want to resize 10, 50 or 200 images? ImageMagick's convert program is just what you need.