[Top][All Lists]

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

Re: RFE: allow bash to have libraries

From: John Kearney
Subject: Re: RFE: allow bash to have libraries
Date: Fri, 02 Mar 2012 01:20:13 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20120129 Thunderbird/10.0

:) :))
Personal best wrote about 10000 lines of code  which finally became
about 200ish to implement a readkey function.

Actually ended up with 2 solutions 1 basted on a full bash script
vt100 parser weighing in a about 500 lines including state tables and
a s00 line hack.

Check out http://mywiki.wooledge.org/ReadingFunctionKeysInBash

Personally I'd have to say using path to source a moduel is a massive
securtiy risk but thats just me.
I actually have a pretty complex bash modules hierarchy solution.
If anybodys interested I guess I could upload it somewhere if anybodys
interested, its just a play thing for me really but its couple 1000
lines of code proabely more like 10000+.
Its kinda why I started updating Gregs wiwi I noticed I'd found
different/better ways of dealing with a lot of problems.

Thiing like secured copy/move funtions. Task Servers.
Generic approach to user interface interactions. i.e. supports both
gui and console input in my scripts.
Or I even started a bash based ncurses type system :), like I say some
fune still got some performance issues with that one.

Or improves select function that supports arrow keys and mouse
selection, written in bash.

Anybody interested in this sort of thing?

On 03/01/2012 11:48 PM, Linda Walsh wrote:
> John Kearney wrote: ... [large repetitive included text elided...]
>> why not just do something like this?
> ---- <26 line suggested 'header' elided...>
>> gives you more control anyway, pretty quick and simple.
> At least 30% of the point of this is to take large amounts of
> common initialization code that ends up at the front of  many or
> most of my scripts and have it hidden in a side file where it can 
> just be 'included'...
> Having to add 26 lines of code just to include 20 common lines
> doesn't sound like a net-gain...
> I thought of doing something similar until I realized I'd end up 
> with some path-search routine written in shell at the beginning of
> each program just to enable bash to have structured & hierarchical
> libraries like any other programming language except maybe BASIC
> (or other shells)
> My problem is I keep thinking problems can be solvable in a few
> lines of shell code.   Then they grow...   *sigh*...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]