Guide to using python for bash-style scripting

4zumanga 4zumanga at gmail.com
Tue May 23 13:27:19 EDT 2006


I have a bunch of really horrible hacked-up bash scripts which I would
really like to convert to python, so I can extend and neaten them.
However, I'm having some trouble mapping some constructs easily, and
was wondering if anyone know of a guide to mapping simple uses of
command line programs to python.

For an example, the kind of thing I am thinking of are things like
(yes, this is horrible code).

# These are a run of a program I have written
./proggy -test1 > out1
./proggy -test2 > out2

#Do some simple manipulation of the output.
grep Node out1 > new_out1
grep Node out2 > new_out2
diff out1 out2




More information about the Python-list mailing list