bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

slight OT: shell-script programing style -- origins and change?


From: Linda Walsh
Subject: slight OT: shell-script programing style -- origins and change?
Date: Sun, 25 Oct 2009 12:05:28 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 Lightning/0.9 Thunderbird/2.0.0.22 ThunderBrowse/3.2.6.5 Mnenhy/0.7.6.666


This is not exactly bash specific, but I was looking at a shell script recently and they use the age old convention of using upper case names for all their shell variables.

At one point I remember this being common practice, but today, ALL CAPS LOOKS LIKE YOU ARE YELLING OR ARE A FOUR OR FIVE YEAR OLD WHO DOESN'T KNOW HOW TO WRITE. (Blech, sorry..). If you thought I was yelling, I made my point.

I was wondering where this convention came from and if it's still considered 'the gold standard' of shell programming.

Personally, there are some legacy variables, maybe system wide
environment variables like USER, and HOME, that make sense and don't
"feel" wrong in allcaps, but for user programs, I'm not sure
allcaps is all that desirable.  Maybe for 'constants'? Even there,
$phi, looks just fine or $pi...

What do others think, (or is there a better venue for this question?)
I thought I 'd ask here first, since bash seems to be
the most advanced and most widely used descendent of the original
Bourne shell, and those most interested in that shell might be
on this list...but that could easily be a misperception on my part.

-linda




reply via email to

[Prev in Thread] Current Thread [Next in Thread]