scripting fun

Steve Lamb grey at dmiyu.org
Fri Jun 6 18:23:43 UTC 2008


On Fri, June 6, 2008 10:39 am, Smoot Carl-Mitchell wrote:
> I agree. When I get beyond a 3 stage pipeline, I generally will write
> something in Perl because I have much finer control in a procedural
> language.

    My personal break point is 2 lines.  If I can't do it in one line in
shell, I generally just break out Python.  That is because dealing with
wrangling shell into doing what I want takes far more time in the long
run than the rare times I need to call out of Python.

> However, for quick and dirty task, it is hard to beat the
> shell with its built in access to the underlying process creation,
> pipelining and I/O redirection mechanism of the operating system.
> Remember, the Unix philosophy is to write simple tools which can be
> pipelined together to perform more complex tasks.

    I never forget that.  However my firm belief is that shell is not a
simple tool nor is it suited for complex tasks and thus, in spite of its
ubiquitous inclusion in Unix is not suited for the philosophy that it
spawned.  I find Python[*] simpler and better suited for complex tasks.

    Or to cloak it in the term you used above I find that shell's built in
access to process creation, pipelining and I/O redirection is easily
beat by its built in access to process creation, pipelining and I/O
redirection.  :D




[*] insert your scripting language of choice here.  Python just happens to
be mine though I concede there are Perl and Ruby people lurking around here
somewhere.  ;)

-- 
Steve Lamb





More information about the ubuntu-users mailing list