"Mark de+la+Fuente" <[EMAIL PROTECTED]> writes: > I need to write simple scripts for executing command line functions. > Up till now I've used C-Shell scripts for this, but I'm looking for > a better alternative. And I keep reading about how “easy” it is to > program with python.
Lots of answers - but everyone concentrated on telling you how to do what you were trying to do, and no one answered your question. Which is actually typical of the c.l.python, but may not be what you want. As others pointed out, Python isn't a shell, or even a shell scripting language, so it doesn't handle what you're doing in a "natural" way. Because of that, it may not be the language for you. Python has features that work well for building large systems, but those tend to cause extra work when you want to do things that other languages make simple. One thing you might consider is changing shells. See <URL: http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/ > for reasons why you might want to drop csh. There's a similar paper discussing the problems with later versions of sh (bash, late ksh, etc.), but from what I recall the problems mostly come from trying to use the extra features that have been added to those shells. So when writing sh scripts, I tend to stay with fundamental bourne features. Other languages have less overhead in invoking external commands. Rexx and Perl come to mind. You might want to give them a look. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list