scripting fun
Smoot Carl-Mitchell
smoot at tic.com
Fri Jun 6 19:05:56 UTC 2008
On Fri, 2008-06-06 at 11:23 -0700, Steve Lamb wrote:
> 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.
Yep. But remember, us old Unix hackers from 20 years ago did not have
all those nifty languages at our disposal. :-) The shell can certainly
be abused. I remember rewriting a long (about 500 line) shell script
which allocated BCVs on an EMC array. After looking at what it did, I
rewrote the whole thing in Perl because the shell script was basically
undecipherable and very difficult to debug. The perl debugger was a
lifesaver in getting the program working.
Often what I end up doing is to do the heavy lifting of a programming
task in a procedural language and then have a simple shell script as a
driver. I am always careful to follow the parameter passing conventions
and the I/O conventions, so I can put the new command in a shell
pipeline, if I need to. Another thing I do religiously id put all the
code I write under some kind of source code control system, so when I
make changes I can back them out if I need to. It also allows me to see
how a program evolves over time.
> 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
LOL.
--
Smoot Carl-Mitchell
System/Network Architect
smoot at tic.com
+1 480 922 7313
cell: +1 602 421 9005
More information about the ubuntu-users
mailing list