|
From: | Steven W. Orr |
Subject: | Re: [Help-bash] starting a central bash script repository |
Date: | Mon, 27 Aug 2012 08:52:25 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 |
On 08/27/12 08:15, quoth Greg Wooledge:
On Sun, Aug 26, 2012 at 04:37:46PM -0500, Peng Yu wrote:For many major program languages, there are central repositories.That's because those other programming languages have the flexibility to write reusable code. Bash code is not reusable in any sane way. You can't pass array names to functions, for example (this is the #1 problem with writing "libraries" of bash code).
I only half agree. I have written a lot of very reusable bash code. Part of the story is the use of upvar / upvars from
http://fvue.nl/wiki/Bash:_Passing_variables_by_reference Part of it is understanding how to use dynamic scoping.So, the bottom line is that it can be done, but it has to be done in the context of an overall framework.
So, where do we go from here? -- Time flies like the wind. Fruit flies like a banana. Stranger things have .0. happened but none stranger than this. Does your driver's license say Organ ..0 Donor?Black holes are where God divided by zero. Listen to me! We are all- 000 individuals! What if this weren't a hypothetical question? steveo at syslang.net
[Prev in Thread] | Current Thread | [Next in Thread] |