On 11.04.2015 09:01, Hongyi Zhao wrote:
> On Fri, 10 Apr 2015 09:37:00 +0200, Janis Papanagnou wrote:
>
>> With shells you can (and often just have to) use external programs.
>> Combining many external tools may lead to severe efficience issues.
>
> Then what about the soul of philosophy for UNIX: program should only
> focus on one goal and do it the best, and then let them work together
> with each other.
Short answer: You can follow a philosophy without thinking, or you can
implement sophisticated solutions; it's your choice.
A bit more formalized an answer is: Assume you have "basic tasks" that
are handled by a set of programs A, B, ..., Z, each an implemention for
a specific "solution domain", and you have a set of "glue operators"
a, b, ..., z. Each program and operator (the combination of programs)
has some costs (execution time, bandwidth, memory, etc.). Now some of
the programs have a larger application domain, covering more then one
topic. Instead of of an implementation of A z B y C x D w E you could
more efficiently do, say, C x F, or just use G.
Also mind that specialized tools in Unix handle usually every variant
of a solution for a specific solution domain, which are not generally
required for specific solutions; so another tool that you already use
in your solution could handle those tasks, so that you don't need to
add another process and communication glue between those processes.
In the current case of shell; why do you think there was an evolution
in shell development (WRT supported features of the technical problem
domain) from bourne shell to ksh and bash? Bourne shell was completely
capable of glueing external specialized programs together. One reason
is just efficiency. Another reason is that it's clumsy (or impossible
in some cases) to pass state information between external tools.
Just to be clear: The "Unix Philosophy" is not wrong. You just should
be aware about the options and implications.
Janis
>
> Regards
>