[clue-tech] bash tip

dperkins at frii.com dperkins at frii.com
Wed Nov 23 12:35:38 MST 2005


> dperkins at frii.com wrote:
>> Those of you who do bash scripting might find this useful.
>> You can treat the contents of a variable as a pointer to another
>> variable.
>>
>> a=17
>> b=a
>>
>> echo $a     prints 17
>> echo $b     prints a
>>
>> echo ${!b}  prints 17
>
> That's cool, and maybe useful.
>
> Bash is really a pretty amazing tool. There was a book around in the
> late 90s called something like _Shell Objects_. Yes, that means what it
> sounds like--that you could do object-oriented programming with the
> shell (which one? I don't remember clearly, but I think it was mainly
> about Bash). I was intrigued, but not quite enough to actually buy it.
>
> --
> Matt Gushee
> The Reluctant Geek: http://matt.gushee.net/rg/

I've found this useful at times but I didn't know it could be done in bash
until yesterday.

I like bash, but I wish its arrays were more powerful.  Maybe in a future
version.

I don't recall seeing the book you mentioned.  It might have been
interesting reading.

_______________________________________________
CLUE-tech mailing list
CLUE-tech at cluedenver.org
http://cluedenver.org/mailman/listinfo/clue-tech



More information about the clue-tech mailing list