Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


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

[Discuss] Bourne Shell variable assignment question



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





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org