Bash

The Über-Skeleton Challenge

I received an interesting message from Angela Kahealani with a challenge: "Here's what I'd like to see in Work the Shell: a full-blown shell script template. It should comply with all standards applicable to CLI programs.

Internationalizing Those Bash Scripts

The first software that I was actually paid to develop was a 2-page shell script that prompted the user for a dozen or so pieces of information, before launching a set of cooperating processes. Those processes formed the core of a performance evaluation suite for the public telephone network - a rather sizable system for its day with high visibility.

Bash Co-Processes

One of the new features in bash 4.0 is the coproc statement. The coproc statement allows you to create a co-process that is connected to the invoking shell via two pipes: one to send input to the co-process and one to get output from the co-process.

Globstar: New Bash Globbing Option

In shell-speak, globbing is what the shell does when you use a wildcard in a command (e.g. * or ?). Globbing is matching the wildcard pattern and returning the file and directory names that match and then replacing the wildcard pattern in the command with the matched items. Bash version 4.0 adds a new globbing option called globstar which treats the pattern ** differently when it's set.

Bash: Handling Command Not Found

After a recent O/S version upgrade (to openSUSE 11.2) I noticed that bash started being a bit more intelligent when I did something stupid: it started giving me a useful error message when I typed the name of a command that wasn't in my PATH but that was in an "sbin" directory. My reaction at the time was "huh, that's nice", but today I decided I needed a bit more information.