Opinion on best practice...

rusi rustompmody at gmail.com
Wed Feb 6 08:32:47 CET 2013


On Feb 6, 6:55 am, Steven D'Aprano <steve
+comp.lang.pyt... at pearwood.info> wrote:

> I would not hesitate to use Python, or some other high-level language like
> Ruby, over bash for anything non-trivial that I cared about. It might not
> be as terse and compact as a well-written bash script, but that's a *good*
> thing, and a poorly-written bash script is likely to be even more verbose
> and difficult to write than a poorly-written Python script.

Maybe you should look at scsh or rc http://paganbooks.eu/software/article/rc-duff

Heres the author of scsh (which would not be saying much were it not
for his uber-geek status)
(from http://www.scsh.net/docu/scsh-paper/scsh-paper-Z-H-1.html )
----------------
Shell programming terrifies me. There is something about writing a
simple shell script that is just much, much more unpleasant than
writing a simple C program, or a simple COMMON LISP program, or a
simple Mips assembler program. Is it trying to remember what the rules
are for all the different quotes? Is it having to look up the multi-
phased interaction between filename expansion, shell variables,
quotation, backslashes and alias expansion? Maybe it's having to
subsequently look up which of the twenty or thirty flags I need for my
grep, sed, and awk invocations. Maybe it just gets on my nerves that I
have to run two complete programs simply to count the number of files
in a directory (ls | wc -l), which seems like several orders of
magnitude more cycles than was really needed.



More information about the Python-list mailing list