[clue-tech] bash tip

Jack Parker jack.parker4 at verizon.net
Wed Nov 23 13:25:11 MST 2005


Haven't played with bash arrays, certainly I've been around with ksh arrays,
but the shell is generally so slow when compared to awk that I usually dip
into awk for more serious work.

At the moment I'm checking data files and the contents thereof for
duplicates, linkages, quality, etc.  Each time I take a slice at it I think
of some new thing I should look for - it is so simple to do this sort of
thing in awk, and the 200MB of data whips through in seconds.  I really
should load it into a database and use SQL, but I can't be bothered to fire
up that machine, plus with the dereferencing of awk I can use the same
script again and again.

Yes I know, perl is better, but I haven't found a need for it yet.

j.

-----Original Message-----
From: clue-tech-bounces at cluedenver.org
[mailto:clue-tech-bounces at cluedenver.org]On Behalf Of dperkins at frii.com
Sent: Wednesday, November 23, 2005 2:36 PM
To: CLUE tech
Subject: Re: [clue-tech] bash tip


> 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

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



More information about the clue-tech mailing list