On Fri, May 31, 2013 at 2:05 PM, Fernando C.V. <ferk...@gmail.com> wrote: > Would it make sense to create a whole shell infrastructure based on > little small commands? > > I mean, not just replacing no-brainer builtin things like "echo", etc, > but also things like "if", "while", "for", "set", by doing system() > calls to an extremelly minimal shell. Would it make sense? maybe even > a command for creating pipes. It wouldn't be POSIX-conformant, but > then just as long as the names don't conflict and the commands were > available the script would run on normal shells too. > > [...]
There is already a solution which does exactly this: `execline`. http://www.skarnet.org/software/execline/ I didn't use it myself, but it seems to fit the profile you're describing. Moreover `skarnet.org` server's seems to be completely reliant on this and a few others. Ciprian. P.S.: Such a solution based heavily on `fork` and `execve` will incur a lot of overhead... (Just this week I've written a few scripts handling a couple hundred thousand files, and they're damn slow...)