[Discuss] Bourne Shell variable assignment question

Jerry Feldman gaf at blu.org
Fri Dec 16 07:28:31 EST 2011


On 12/15/2011 07:14 PM, Richard Pieri wrote:
> On Dec 15, 2011, at 4:35 PM, Jerry Feldman wrote:
>> This is 100% agreed. The issue is that he does not want to source the
>> file and I have not been able to talk him out of it. In the past I have
>> written scripts where you could read the name of a variable, and then
>> convert it to a variable name, but I don't think I've done it in Bourne
>> of BASH.
> You pretty well have to politely inform this person that he's an idiot.  You could do something like this:
He is not a trained programmer. I have not seen some of the other
programs he has written. I'm usually pretty critical of inefficient
code. One thing I do in nearly all of my scripts is to set up variables
for commants, such as:
RM=/bin/rm
I also set up a prefix, or path to where my script is run from. So,
let's say my code is in /foo/bin, but there is a symlink in
/usr/local/bin. I set up the prefix so that it resolves the symlink so
when I source other files, I get them from the exact same place. This is
simple in BASH, but a bit tricky in tcl.

-- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix
PGP key id:3BC1EB90 
PGP Key fingerprint: 49E2 C52A FC5A A31F 8D66  C0AF 7CEA 30FC 3BC1 EB90




More information about the Discuss mailing list