...making Linux just a little more fun!

<-- prev | next -->

A Shell Named Westley

By Theresa L Ford

I think of the different shells as clones of little worker guys. sh drinks beer, sports a nice beer belly, and is quite content to do what you ask him to. bash drinks beer AND smokes cigars. ksh is an outdoor barbeque type who likes food and sports with whatever drink is handy. csh only drinks dry martinis and has a dark sense of humor. Each of these worker types speaks a slightly different dialect and gets confused if you offer him beer when he distinctly requires a dry martini. Each has his own unique DNA (sometimes referred to as initialization scripts).

You can change which shell worker type you want to order around on a routine basis using a magic wand etched with the word 'chsh' to point at the one you want to come running first. This doesn't limit you, though, because you can always clone a new one of any type by saying his name. The conscription of new workers can even be done inside files using a #! whip.

Each worker does his job at a minimum wage of $0, but may require some training and additional $'s, maybe 1-9, and will tell you how much you gave as a simple $#. If you overpay him, you might have to shift his wages a little. Sometimes, the worker can be paid in special loot like gems, $* (equivalent to all given), or $@ (also equivalent to all given but requires that the worker spend proceeds only after careful consideration of all estimate quotes).

Additionally, each worker operates under specific user permissions and may have problems if you tell him to do something he isn't allowed to do. He has a distinct personality and only sometimes likes to interact with you; in fact, these workers can hide from you in the background (sly buggers, these shells!) or let you watch them operate.

Each worker can request another worker clone (of any installed type), called its child, through a process named 'spawning'. He can learn a specialized vocabulary (if you define each new word as a variable) and is even capable of sharing his vocabulary with his children, but only if you specifically tell him to! Though he'll forget some of his words if you unsettle him.

If you give him enough $$, he'll tell you who he is. If he's hiding, you have to shout ($!) to get his attention so he'll tell you who he is. You can ask him a question ($?) and he will tell you how he did at his task. In all, I think I shall name all my shell worker clones "Westley", call them "Farm Boy", and expect them to respond, "As you wish..."

Additional Information

[See also the author's origami page with animated GIFs. -Editor.]


[BIO] Easily amused by many things, Theresa L. Ford plays with computers, origami, wild plants, hydroponics, writing, and games. You can peek into her mind at her website: Cattail.nu.

Copyright © 2004, Theresa L Ford. Released under the Open Publication license unless otherwise noted in the body of the article. Linux Gazette is not produced, sponsored, or endorsed by its prior host, SSC, Inc.

Published in Issue 102 of Linux Gazette, May 2004

<-- prev | next -->