Re: bash vs. python scripts - which one is better?

2007-08-22 Thread David Brodbeck
On Aug 22, 2007, at 4:57 AM, Vincent Lefevre wrote: On 2007-08-21 09:55:46 -0700, David Brodbeck wrote: Linux is the only *nix-ish OS I've used where /bin/sh and bash are synonymous. ;) You probably haven't used it, but under Mac OS X too: prunille:~> uname -a Darwin prunille.vinc17.org 8.1

Re: bash vs. python scripts - which one is better?

2007-08-22 Thread Vincent Lefevre
On 2007-08-22 13:53:34 +0200, Vincent Lefevre wrote: > Now, what about the following test, which does not test file existence? > > [EMAIL PROTECTED]:~$ [ true -a \( ! -a \) ] && echo OK > bash: [: `)' expected, found ] > [EMAIL PROTECTED]:~$ /usr/bin/[ true -a \( ! -a \) ] && echo OK > [EMAIL PROT

Re: bash vs. python scripts - which one is better?

2007-08-22 Thread Vincent Lefevre
On 2007-08-21 09:55:46 -0700, David Brodbeck wrote: > Linux is the only *nix-ish OS I've used where /bin/sh and bash are > synonymous. ;) You probably haven't used it, but under Mac OS X too: prunille:~> uname -a Darwin prunille.vinc17.org 8.10.0 Darwin Kernel Version 8.10.0: Wed May 23 16:50:5

Re: bash vs. python scripts - which one is better?

2007-08-22 Thread Vincent Lefevre
On 2007-08-21 17:50:53 -0600, Bob Proulx wrote: > Vincent Lefevre wrote: > > vin:~> bash > > [EMAIL PROTECTED]:~$ touch exists > > [EMAIL PROTECTED]:~$ [ ! -a exists ] || echo found > > [EMAIL PROTECTED]:~$ /usr/bin/[ ! -a exists ] || echo found > > found > > You are running afoul of -a ambiguity.

Re: Python init (was: bash vs. python scripts - which one is better?)

2007-08-21 Thread Douglas A. Tutty
On Tue, Aug 21, 2007 at 02:07:23PM -0400, Rick Thomas wrote: > On Aug 20, 2007, at 10:45 PM, Steve Lamb wrote: > > >When it comes to Python in a role of system initialization > >there are some very simple things one can do that would > >dramatically increase load times. First off the pre-c

Re: bash vs. python scripts - which one is better?

2007-08-21 Thread John Hasler
Bob writes: > Not synonymous, just the most prevalent from the distros. It can be > changed and any bugs found in other packages that use bash features > without properly calling bash reported. Note that when bash is invoked with the name sh, it tries to mimic the startup behavior of historical v

Re: bash vs. python scripts - which one is better?

2007-08-21 Thread Bob Proulx
David Brodbeck wrote: > Vincent Lefevre wrote: > >I suppose they have their own sh. Because bash is also under active > >development (and has broken scripts several times in the past). > > Yeah, FreeBSD ships its own, less featureful (but more compact!) > version of sh, with bash available as a

Re: bash vs. python scripts - which one is better?

2007-08-21 Thread Bob Proulx
Vincent Lefevre wrote: > Bob Proulx wrote: > > The test command was originally not a shell built-in. It was an > > external standalong /bin/test command. For performance reasons it has > > I don't think it is for performance reasons. Have you ever seen any > noticeable performance gain? I don't

Re: bash vs. python scripts - which one is better?

2007-08-21 Thread Andrei Popescu
On Tue, Aug 21, 2007 at 09:55:46AM -0700, David Brodbeck wrote: > > On Aug 20, 2007, at 9:46 PM, Vincent Lefevre wrote: >> I suppose they have their own sh. Because bash is also under active >> development (and has broken scripts several times in the past). > > Yeah, FreeBSD ships its own, less fea

Re: Python init (was: bash vs. python scripts - which one is better?)

2007-08-21 Thread Rick Thomas
On Aug 20, 2007, at 10:45 PM, Steve Lamb wrote: When it comes to Python in a role of system initialization there are some very simple things one can do that would dramatically increase load times. First off the pre-compiling of modules that Python does means subsequent boots would not

Re: bash vs. python scripts - which one is better?

2007-08-21 Thread David Brodbeck
On Aug 20, 2007, at 9:46 PM, Vincent Lefevre wrote: I suppose they have their own sh. Because bash is also under active development (and has broken scripts several times in the past). Yeah, FreeBSD ships its own, less featureful (but more compact!) version of sh, with bash available as a por

Re: bash vs. python scripts - which one is better?

2007-08-20 Thread Vincent Lefevre
On 2007-08-19 23:03:50 -0500, Anthony M Simonelli wrote: > How about Zenity? I've used it before to provide a GUI interface to > some of my simple bash scripts. It seems that the UI::Dialog Perl module allows to use the same interface to various dialog backends (including zenity). This is particu

Re: Python init (was: bash vs. python scripts - which one is better?)

2007-08-20 Thread Vincent Lefevre
On 2007-08-20 19:45:19 -0700, Steve Lamb wrote: >> There are also maintenance issues with incorporating a complex language >> that's under active development as a critical part of an operating system. >> FreeBSD dropped Perl from their base system because "base Perl" became >> such a pain to ma

Re: bash vs. python scripts - which one is better?

2007-08-20 Thread Vincent Lefevre
On 2007-08-20 10:38:32 -0700, David Brodbeck wrote: > There are also maintenance issues with incorporating a complex > language that's under active development as a critical part of an > operating system. FreeBSD dropped Perl from their base system > because "base Perl" became such a pain to mainta

Re: bash vs. python scripts - which one is better?

2007-08-20 Thread Vincent Lefevre
On 2007-08-19 18:26:38 -0400, Douglas A. Tutty wrote: > > >if [ $foo == "" ] > Yeah, and the spaces between the [ $ and the " ] are critical too; I > just forget in what way. Yes, because of tokenization. But tokenization is a notion that exists in every language. Now, unlike in Python (with its i

Re: bash vs. python scripts - which one is better?

2007-08-20 Thread Vincent Lefevre
On 2007-08-19 21:23:12 -0600, Bob Proulx wrote: > Manon Metten wrote: > > David Brodbeck wrote: > > > It certainly has its warts. In particular, Bash's "test" (aka "[") > > > operator has pitfalls. > > The test command was originally not a shell built-in. It was an > external standalong /bin/tes

Re: bash vs. python scripts - which one is better?

2007-08-20 Thread Vincent Lefevre
On 2007-08-19 12:56:51 -0700, David Brodbeck wrote: > It certainly has its warts. In particular, Bash's "test" (aka "[") > operator has pitfalls. Testing for an empty variable, for example, is > awkward. If you do: > > if [ $foo == "" ] > > Bash will complain about missing arguments. Yes, bas

Re: bash vs. python scripts - which one is better?

2007-08-20 Thread Vincent Lefevre
On 2007-08-18 22:33:57 -0400, Douglas A. Tutty wrote: > I guess a problem is the lack of definition of 'clean coding'. I don't > consider one-liners as clean code. One-liners *can* be clean code. I have lots of very clean and readable one-liners in my Makefiles. Also, I like the following one (v

Python init (was: bash vs. python scripts - which one is better?)

2007-08-20 Thread Steve Lamb
David Brodbeck wrote: The other is that the load time for bash is shorter. Everyone complains that their system boots too slowly as it is. ;) Microscopically. On the other hand it has been my experience that it isn't the load time of bash that is the problem, it is the constant fork/exec

Re: bash vs. python scripts - which one is better?

2007-08-20 Thread Douglas A. Tutty
On Sun, Aug 19, 2007 at 11:03:50PM -0500, Anthony M Simonelli wrote: > On Sun, 2007-08-19 at 14:35 -0500, Ron Johnson wrote: > > > Python + Tcl/Tk should be easier than Python + Gtk. > > > > Even simpler would be bash + dialog or it's GUI companion gtkdialog. > > > > How about Zenity? I've use

Re: bash vs. python scripts - which one is better?

2007-08-20 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/20/07 11:39, Manon Metten wrote: > Hi Ron, > > On 8/20/07, Ron Johnson <[EMAIL PROTECTED]> wrote: > > Thanks for the links. You surely know how to find something. > > > >>> I find this much more comfortable than eg. typing: > rx mp3conv.

Re: bash vs. python scripts - which one is better?

2007-08-20 Thread David Brodbeck
On Aug 19, 2007, at 2:40 PM, Steve Lamb wrote: Besides, until operating systems start having init scripts written in Perl or Python, being able to write shell scripts is going to be an essential system administration skill. ;) Quite frankly they should now. Any time I've had to throw

Re: bash vs. python scripts - which one is better?

2007-08-20 Thread Manon Metten
Hi Anthony, On 8/20/07, Anthony M Simonelli <[EMAIL PROTECTED]> wrote: How about Zenity? I've used it before to provide a GUI interface to > some of my simple bash scripts. Thanks for the tip. Gonna check this out too. Greetings, Manon.

Re: bash vs. python scripts - which one is better?

2007-08-20 Thread Manon Metten
Hi Douglas, On 8/19/07, Douglas A. Tutty <[EMAIL PROTECTED]> wrote: However, I don't understand the concept of compeletly controlling and > editor from a script. Everything I can do by accessing a menu item or hitting some keys, I can do from within a script, and even more. I still haven't fo

Re: bash vs. python scripts - which one is better?

2007-08-20 Thread Manon Metten
Hi Bob, On 8/20/07, Bob Proulx <[EMAIL PROTECTED]> wrote: > Thanks. I copied this to my 'Bash-howto'. > > I would hate to see you record this in your howto with "==" without > knowing that "==" is a bash specific feature. :-) Well, actually it ain't that hard. I know from C that = assigns a

Re: bash vs. python scripts - which one is better?

2007-08-20 Thread Manon Metten
Hi Ron, On 8/20/07, Ron Johnson <[EMAIL PROTECTED]> wrote: Thanks for the links. You surely know how to find something. >> I find this much more comfortable than eg. typing: > >>> rx mp3conv.rexx 256kbps ~/mp3/work > >>> Even better: I run this script from within my dir util (DirOpus == > >>>

Re: bash vs. python scripts - which one is better?

2007-08-19 Thread Anthony M Simonelli
On Sun, 2007-08-19 at 14:35 -0500, Ron Johnson wrote: > Python + Tcl/Tk should be easier than Python + Gtk. > > Even simpler would be bash + dialog or it's GUI companion gtkdialog. > How about Zenity? I've used it before to provide a GUI interface to some of my simple bash scripts. -- To UN

Re: bash vs. python scripts - which one is better?

2007-08-19 Thread Bob Proulx
Manon Metten wrote: > David Brodbeck wrote: > > It certainly has its warts. In particular, Bash's "test" (aka "[") > > operator has pitfalls. The test command was originally not a shell built-in. It was an external standalong /bin/test command. For performance reasons it has been incorporated i

Re: bash vs. python scripts - which one is better?

2007-08-19 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/19/07 14:48, Manon Metten wrote: > Hi Ron, > > On 8/19/07, Ron Johnson <[EMAIL PROTECTED]> wrote: > > Python + Tcl/Tk should be easier than Python + Gtk. > > > Thanks. > > > Even simpler would be bash + dialog or it's GUI companion gtkdialo

Re: bash vs. python scripts - which one is better?

2007-08-19 Thread Douglas A. Tutty
On Sun, Aug 19, 2007 at 02:40:19PM -0700, Steve Lamb wrote: > David Brodbeck wrote: > > In particular, Bash's "test" (aka "[") > >operator has pitfalls. Testing for an empty variable, for example, is > >awkward. If you do: > > >if [ $foo == "" ] Yeah, and the spaces between the [ $ and the " ]

Re: bash vs. python scripts - which one is better?

2007-08-19 Thread Steve Lamb
David Brodbeck wrote: > In particular, Bash's "test" (aka "[") operator has pitfalls. Testing for an empty variable, for example, is awkward. If you do: if [ $foo == "" ] Yeah, prefer: if not foo: do something -- there are few languages where it's quite so easy to test conditions

Re: bash vs. python scripts - which one is better?

2007-08-19 Thread Douglas A. Tutty
On Sun, Aug 19, 2007 at 09:12:52PM +0200, Manon Metten wrote: > But I have a second question: Is there a programmable text editor > available (with a nice GUI - not something like emacs where I have to > remember all those ctrl+shift+left-alt+m commands) that I can > completely control from withi

Re: bash vs. python scripts - which one is better?

2007-08-19 Thread Manon Metten
Hi David, On 8/19/07, David Brodbeck <[EMAIL PROTECTED]> wrote: It certainly has its warts. In particular, Bash's "test" (aka "[") > operator has pitfalls. Testing for an empty variable, for example, > is awkward. If you do: > > if [ $foo == "" ] > > Bash will complain about missing arguments.

Re: bash vs. python scripts - which one is better?

2007-08-19 Thread David Brodbeck
On Aug 18, 2007, at 12:20 PM, Douglas A. Tutty wrote: Also, I find that some of the bash constructs are cryptic by their nature with no clean work-arounds. They are likely perfectly clear to a proficient bash coder but the finer points are lost on me. It certainly has its warts. In partic

Re: bash vs. python scripts - which one is better?

2007-08-19 Thread Manon Metten
Hi Ron, On 8/19/07, Ron Johnson <[EMAIL PROTECTED]> wrote: Python + Tcl/Tk should be easier than Python + Gtk. Thanks. Even simpler would be bash + dialog or it's GUI companion gtkdialog. Could you mail me some examples you wrote, please? > I find this much more comfortable than eg. typi

Re: bash vs. python scripts - which one is better?

2007-08-19 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/19/07 14:12, Manon Metten wrote: [snip] > > Here's an example: I've written a script in ARexx for creating mp3 files. It > has a > couple of modes: Scale - 192kbps - 256kbps - Cancel. So when I run this > script, > it opens a small window with t

Re: bash vs. python scripts - which one is better?

2007-08-19 Thread Manon Metten
Hi Douglas, On 8/19/07, Douglas A. Tutty <[EMAIL PROTECTED]> almost wrote: Perhaps the OP can restate her needs and we can help her make a reasoned > choice without it becoming a religious issue. > OK. I have a hard time to remember all those command line options. So whenever I have to accompli

Re: bash vs. python scripts - which one is better?

2007-08-18 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/18/07 21:33, Douglas A. Tutty wrote: [snip] > > I guess a problem is the lack of definition of 'clean coding'. I don't > consider one-liners as clean code. Terse yes but they lack the visual > flow that I need when I need to revamp code a year

Re: bash vs. python scripts - which one is better?

2007-08-18 Thread Douglas A. Tutty
On Sat, Aug 18, 2007 at 08:30:04PM -0500, Ron Johnson wrote: > On 08/18/07 18:28, Steve Lamb wrote: > > Ron Johnson wrote: > >> I've written enough cryptic Python and lucid C & bash to know that > >> Python does *not* enforce clean coding. > > > > I don't think anyone has ever claimed that. >

Re: bash vs. python scripts - which one is better?

2007-08-18 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/18/07 18:28, Steve Lamb wrote: > Ron Johnson wrote: >> I've written enough cryptic Python and lucid C & bash to know that >> Python does *not* enforce clean coding. > > I don't think anyone has ever claimed that. Doug Tutty did this afterno

Re: bash vs. python scripts - which one is better?

2007-08-18 Thread Nate Duehr
On Aug 18, 2007, at 5:28 PM, Steve Lamb wrote: Ron Johnson wrote: I've written enough cryptic Python and lucid C & bash to know that Python does *not* enforce clean coding. I don't think anyone has ever claimed that. What a waste. bash is *great* for looping thru lists. (Perfect? No.

Re: bash vs. python scripts - which one is better?

2007-08-18 Thread Steve Lamb
Ron Johnson wrote: I've written enough cryptic Python and lucid C & bash to know that Python does *not* enforce clean coding. I don't think anyone has ever claimed that. What a waste. bash is *great* for looping thru lists. (Perfect? No. But still great.) So is Python with the ad

Re: bash vs. python scripts - which one is better?

2007-08-18 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/18/07 14:20, Douglas A. Tutty wrote: > On Sat, Aug 18, 2007 at 08:52:45PM +0200, Manon Metten wrote: >> Thanks for sharing your valuable experience. I've decided to first become >> more familiar with Bash and then I'll give Python a try. If it do

Re: bash vs. python scripts - which one is better?

2007-08-18 Thread Douglas A. Tutty
On Sat, Aug 18, 2007 at 08:52:45PM +0200, Manon Metten wrote: > > Thanks for sharing your valuable experience. I've decided to first become > more familiar with Bash and then I'll give Python a try. If it don't like > it, I > can always try something else. But ATM I think Python will be the best >

Re: bash vs. python scripts - which one is better?

2007-08-18 Thread Manon Metten
Hi Steve, Thanks for sharing your valuable experience. I've decided to first become more familiar with Bash and then I'll give Python a try. If it don't like it, I can always try something else. But ATM I think Python will be the best option. I've seen some code on the net that looks pretty clean

Re: bash vs. python scripts - which one is better?

2007-08-16 Thread Andrew Sackville-West
On Tue, Aug 14, 2007 at 09:17:46AM -0700, Bob McGowan wrote: > Steven R. wrote: >> On Tue, Aug 07, 2007 at 04:03:05PM -0700, Andrew Sackville-West wrote: >>> So what's the right way to do this? I hacked one together the other >>> day: >>> >>> IFS=$'\t\n'; for i in `find . -iname \*m4a`; do faad...

Re: bash vs. python scripts - which one is better?

2007-08-15 Thread Dan H
On Sat, 11 Aug 2007 00:52:18 - BartlebyScrivener <[EMAIL PROTECTED]> wrote: > from http://docs.python.org/tut/node3.html > > If you're a professional software developer, you may have to work > with several C/C++/Java libraries but find the usual > write/compile/test/re- compile cycle is too sl

Re: bash vs. python scripts - which one is better?

2007-08-14 Thread Bob McGowan
Steven R. wrote: On Tue, Aug 07, 2007 at 04:03:05PM -0700, Andrew Sackville-West wrote: So what's the right way to do this? I hacked one together the other day: IFS=$'\t\n'; for i in `find . -iname \*m4a`; do faad... blah blah blah and I knew it was a hack because setting $IFS just seems bad..

Re: bash vs. python scripts - which one is better?

2007-08-14 Thread Martin Marcher
Hi, personally I'd say they both equally powerfull in general (I think both a touring complete which makes them both full grown programming languages - correct me if i'm wrong) depending on the job i use one over the other. If it would be a python script only spawning OS processes it might be a l

Re: bash vs. python scripts - which one is better?

2007-08-14 Thread Vincent Lefevre
On 2007-08-14 09:32:44 -0400, Steven R. wrote: > On Tue, Aug 07, 2007 at 04:03:05PM -0700, Andrew Sackville-West wrote: > > > > So what's the right way to do this? I hacked one together the other > > day: > > > > IFS=$'\t\n'; for i in `find . -iname \*m4a`; do faad... blah blah blah > > > > and

Re: bash vs. python scripts - which one is better?

2007-08-14 Thread Vincent Lefevre
On 2007-08-13 14:40:57 -0700, David Brodbeck wrote: > On Aug 13, 2007, at 11:31 AM, Vincent Lefevre wrote: >> There's a big difference: GCC is useless for the end user. And >> I don't think that old GCC versions are really necessary. > > They are if you need to compile old software. Some stuff just

Re: bash vs. python scripts - which one is better?

2007-08-14 Thread Steven R.
On Tue, Aug 07, 2007 at 04:03:05PM -0700, Andrew Sackville-West wrote: > > So what's the right way to do this? I hacked one together the other > day: > > IFS=$'\t\n'; for i in `find . -iname \*m4a`; do faad... blah blah blah > > and I knew it was a hack because setting $IFS just seems > bad... p

Re: bash vs. python scripts - which one is better?

2007-08-13 Thread David Brodbeck
On Aug 13, 2007, at 11:31 AM, Vincent Lefevre wrote: There's a big difference: GCC is useless for the end user. And I don't think that old GCC versions are really necessary. They are if you need to compile old software. Some stuff just won't build with newer GCC versions. Also, your end u

Re: bash vs. python scripts - which one is better?

2007-08-13 Thread Vincent Lefevre
On 2007-08-13 09:18:46 -0700, David Brodbeck wrote: > On Aug 11, 2007, at 12:09 PM, Vincent Lefevre wrote: >> Concerning python, >> one still has 5 different versions (python2.1, python2.2, python2.3, >> python2.4, python2.5) in currently supported Debian versions! > > Yeah, and old GCC versions ha

Re: bash vs. python scripts - which one is better?

2007-08-13 Thread David Brodbeck
On Aug 11, 2007, at 12:09 PM, Vincent Lefevre wrote: Concerning python, one still has 5 different versions (python2.1, python2.2, python2.3, python2.4, python2.5) in currently supported Debian versions! Yeah, and old GCC versions have to be kept around, too, for similar reasons. It's annoyi

Re: bash vs. python scripts - which one is better?

2007-08-12 Thread Steve Lamb
Vincent Lefevre wrote: > On 2007-08-11 11:34:48 -0700, Steve Lamb wrote: >> Really? Tell that to the Perl 4 programmers. > Perl 4 is obsolete and no longer used, and has complete disappeared > from Debian a long time ago. I'm not the one who used "Never". > Concerning python, > one stil

Re: bash vs. python scripts - which one is better?

2007-08-11 Thread Vincent Lefevre
On 2007-08-12 00:57:22 +0100, William Pursell wrote: > Here is a method for doing a timeout. I'm not arguing against > the claim that sh is limited, nor am I claiming that the method > presented here is robust (it doesn't work well if the function > has already completed, for example), but this ce

Re: bash vs. python scripts - which one is better?

2007-08-11 Thread William Pursell
Vincent Lefevre wrote: Not every system has bash. If this is for compatibility, you can learn POSIX sh, but e.g. Solaris /bin/sh is not a POSIX sh. For this reason and because POSIX sh is limited (you can't execute a command and have a timeout on it), Here is a method for doing a timeout. I'

Re: bash vs. python scripts - which one is better?

2007-08-11 Thread Brendan
On Saturday 11 August 2007, Vincent Lefevre wrote: > On 2007-08-11 11:34:48 -0700, Steve Lamb wrote: > > Really? Tell that to the Perl 4 programmers. > > Perl 4 is obsolete and no longer used, and has complete disappeared > from Debian a long time ago. Perl 5 has been there since 13 years > (a

Re: bash vs. python scripts - which one is better?

2007-08-11 Thread Vincent Lefevre
On 2007-08-11 11:34:48 -0700, Steve Lamb wrote: > Really? Tell that to the Perl 4 programmers. Perl 4 is obsolete and no longer used, and has complete disappeared from Debian a long time ago. Perl 5 has been there since 13 years (about the same time python 1.0 was released). Concerning python

Re: bash vs. python scripts - which one is better?

2007-08-11 Thread Steve Lamb
Vincent Lefevre wrote: > A part of the language is a bit obsolete. Some features are deprecated > (but can be useful for some one-liners). Unlike Python, nothing is > removed from Perl, so that old Perl scripts can still run and there > is no need for N versions on the disk. Really? Tell that

Re: bash vs. python scripts - which one is better?

2007-08-11 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/10/07 23:43, Stefan Monnier wrote: >>> Haskell defines TABs as being 8 spaces apart and I expect Python to do >>> the same. > >> Python should do it because Haskell does it?? > > Not because Haskell is so influential, but because the same cause

Re: bash vs. python scripts - which one is better?

2007-08-11 Thread Vincent Lefevre
On 2007-08-11 00:44:17 -0700, Steve Lamb wrote: > Vincent Lefevre wrote: > >>> Imagine a filename contains: ' `some command` > > > Yes, because you get: > > > echo '' `ls -l`' > > I get? *I* get? Pst, look up above. *YOU* decided say "Imagine a > filename contains: ' `some command` Quo

Re: bash vs. python scripts - which one is better?

2007-08-11 Thread Steve Lamb
Vincent Lefevre wrote: >>> Imagine a filename contains: ' `some command` > Yes, because you get: > echo '' `ls -l`' I get? *I* get? Pst, look up above. *YOU* decided say "Imagine a filename contains: ' `some command` Quoted right there. > which is not valid. Try with: So now you'

Re: bash vs. python scripts - which one is better?

2007-08-10 Thread Stefan Monnier
>> Haskell defines TABs as being 8 spaces apart and I expect Python to do >> the same. > Python should do it because Haskell does it?? Not because Haskell is so influential, but because the same causes tend to result in the same effects. Stefan -- To UNSUBSCRIBE, email to [EMAIL PROT

Re: bash vs. python scripts - which one is better?

2007-08-10 Thread Vincent Lefevre
On 2007-08-09 23:48:03 -0700, Steve Lamb wrote: > Vincent Lefevre wrote: > > Braces are not a problem: they are kept in a copy-paste, and if for > > some reason a brace is missing (because you did a mistake), then you'll > > get a syntax error > > Unless, of course, you are programming in C w

Re: bash vs. python scripts - which one is better?

2007-08-10 Thread Vincent Lefevre
On 2007-08-09 23:37:52 -0700, Steve Lamb wrote: > Vincent Lefevre wrote: > > On 2007-08-09 09:48:54 -0700, Steve Lamb wrote: > >> The same in Python but with far greater functionality: > > > and a security hole! > > And the one liner stopped this how, exactly? Because the result of a par

Re: bash vs. python scripts - which one is better?

2007-08-10 Thread BartlebyScrivener
On Aug 7, 1:50 pm, "Manon Metten" <[EMAIL PROTECTED]> wrote: > - Which one is easiest to learn? > - Which one is more powerful? > - Can I execute /bin commands from within a python script Sorry if someone else already pointed to the Python Tutorial, but the very beginning tries to address when yo

Re: bash vs. python scripts - which one is better?

2007-08-10 Thread Brendan
On Thursday 09 August 2007, Nelson Castillo wrote: > On 8/9/07, David Brodbeck <[EMAIL PROTECTED]> wrote: > > On Aug 9, 2007, at 10:19 AM, Steve Lamb wrote: > > > Actually, it isn't. At no time have I ever had any problems > > > with Python > > > code which would not also be an issue in other

Re: bash vs. python scripts - which one is better?

2007-08-10 Thread Brendan
On Thursday 09 August 2007, Manon Metten wrote: > Hi Florian, > > On 8/8/07, Florian Kulzer <[EMAIL PROTECTED]> wrote: > > http://www.tldp.org/LDP/Bash-Beginners-Guide/html/index.html > > > http://www.comp.leeds.ac.uk/Perl/start.html > > http://hetland.org/writing/instant-python.html > > Thanks for

Re: bash vs. python scripts - which one is better?

2007-08-10 Thread s. keeling
ss11223 <[EMAIL PROTECTED]>: > On Aug 10, 10:30 am, "s. keeling" <[EMAIL PROTECTED]> wrote: > > Ron Johnson <[EMAIL PROTECTED]>: > > > > > > Just remember to tell you editor to "inserts spaces as tab" and set > > > the tab width to something reasonable like 4. > > > > E, yuck! It's code lik

Re: bash vs. python scripts - which one is better?

2007-08-10 Thread ss11223
On Aug 10, 10:30 am, "s. keeling" <[EMAIL PROTECTED]> wrote: > Ron Johnson <[EMAIL PROTECTED]>: > > > > > Just remember to tell you editor to "inserts spaces as tab" and set > > the tab width to something reasonable like 4. > > E, yuck! It's code like that which makes me happy for emacs: > >

Re: bash vs. python scripts - which one is better?

2007-08-10 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/10/07 09:18, s. keeling wrote: > Ron Johnson <[EMAIL PROTECTED]>: >> Just remember to tell you editor to "inserts spaces as tab" and set >> the tab width to something reasonable like 4. > > E, yuck! It's code like that which makes me happ

Re: bash vs. python scripts - which one is better?

2007-08-10 Thread s. keeling
Ron Johnson <[EMAIL PROTECTED]>: > > Just remember to tell you editor to "inserts spaces as tab" and set > the tab width to something reasonable like 4. E, yuck! It's code like that which makes me happy for emacs: C-x h# mark entire buffer M-x untabify # repl

Re: bash vs. python scripts - which one is better?

2007-08-10 Thread Steve Lamb
Nate Duehr wrote: > And when you venture past yours, you'll find that ALL programming > languages have SERIOUS flaws in them... and that most can get this > particular relatively simple job done, just fine, with fairly similar > amounts of effort by someone who is sufficiently skilled in that > par

Re: bash vs. python scripts - which one is better?

2007-08-10 Thread Nate Duehr
On Aug 10, 2007, at 12:19 AM, Steve Lamb wrote: Uh, no, fanboi. I never said it had to remain a one liner. In fact, that was my point. One liners rarely stay that way. And when you venture past your very narrow mindset you find the problems in shell. And when you venture past your

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Steve Lamb
Vincent Lefevre wrote: > Braces are not a problem: they are kept in a copy-paste, and if for > some reason a brace is missing (because you did a mistake), then you'll > get a syntax error Unless, of course, you are programming in C with that pesky... if foo; bar; ...problem. > In Py

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Steve Lamb
Vincent Lefevre wrote: > On 2007-08-09 09:48:54 -0700, Steve Lamb wrote: >> The same in Python but with far greater functionality: > and a security hole! And the one liner stopped this how, exactly? I mean it was globbing the file fer pete's sake! >> result = os.system("lame -h

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Steve Lamb
Nate Duehr wrote: > Steve Lamb wrote: > >> Quick, take your one liner, have it traverse an entire directory tree >> converting all the wavs (regardless of capitalization) to mp3s, oggs >> and flac, sorting all 4 into their own directory trees. > To make your point, you'd need to do all of the

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/09/07 23:08, Miles Bader wrote: > Ron Johnson <[EMAIL PROTECTED]> writes: >> For example, the DEC VT220 allowed you to change the tab stops, and >> make as many as you wanted. Not sure about the VT100, but wouldn't >> be surprised. > > The vt10

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Miles Bader
Ron Johnson <[EMAIL PROTECTED]> writes: > For example, the DEC VT220 allowed you to change the tab stops, and > make as many as you wanted. Not sure about the VT100, but wouldn't > be surprised. The vt100 had a special setup screen for "setting tab stops", though I don't know what exactly was eff

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Vincent Lefevre
On 2007-08-09 13:27:31 -0700, David Brodbeck wrote: > Still, after dealing with all the nightmares of things like 'make' that > care about tabs vs. spaces, etc., I'm inclined to shy away from languages > where whitespace is critically important. Whitespace is so fragile. Yes. BTW, I wonder what

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Vincent Lefevre
On 2007-08-09 10:19:51 -0700, Steve Lamb wrote: > Actually, it isn't. At no time have I ever had any problems with > Python code which would not also be an issue in other code as well. > The only difference being you have to be careful about indention in > one case, braces in the other. Braces

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Vincent Lefevre
On 2007-08-09 09:48:54 -0700, Steve Lamb wrote: > The same in Python but with far greater functionality: and a security hole! > import os > for file in os.listdir('.'): > root, ext = os.path.splitext(file) > if ext.lower() == 'wav': > mp3 = root + '.mp3' > result = os.

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/09/07 15:28, Stefan Monnier wrote: >> Just remember to tell you editor to "inserts spaces as tab" and set >> the tab width to something reasonable like 4. > > Please don't. TABs are 8 spaces apart. Always have been, always will be. Shows how

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Miles Bader
Stefan Monnier <[EMAIL PROTECTED]> writes: > Please don't. TABs are 8 spaces apart. Always have been, always will be. > People playing silly tricks with tab-width is the main reason why using TABs > in languages like Python is a bad idea. Or to put it another way, the main reason why languages l

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Mathias Brodala
Hi Jochen. Jochen Schulz, 09.08.2007 23:42: > Nelson Castillo: >> I make trailing spaces and TABS visible in vim. >> I know it's hard to keep conventions when you work with a team. >> >> http://wiki.freaks-unidos.net/weblogs/arhuaco/visible-spaces-in-vim > > I am using > > set listchars=tab:»·,t

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Nate Duehr
Steve Lamb wrote: Quick, take your one liner, have it traverse an entire directory tree converting all the wavs (regardless of capitalization) to mp3s, oggs and flac, sorting all 4 into their own directory trees. For me I just need to change my small script into a function, wrap it insi

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Jochen Schulz
Nelson Castillo: > > I make trailing spaces and TABS visible in vim. > I know it's hard to keep conventions when you work with a team. > > http://wiki.freaks-unidos.net/weblogs/arhuaco/visible-spaces-in-vim I am using set listchars=tab:»·,trail:· in my ~/.vimrc. That makes tabs and taling spac

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Steve Lamb
Stefan Monnier wrote: >> Just remember to tell you editor to "inserts spaces as tab" and set >> the tab width to something reasonable like 4. > Please don't. TABs are 8 spaces apart. Always have been, always will be. > People playing silly tricks with tab-width is the main reason why using TABs

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Stefan Monnier
> Just remember to tell you editor to "inserts spaces as tab" and set > the tab width to something reasonable like 4. Please don't. TABs are 8 spaces apart. Always have been, always will be. People playing silly tricks with tab-width is the main reason why using TABs in languages like Python is

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Nelson Castillo
On 8/9/07, David Brodbeck <[EMAIL PROTECTED]> wrote: > > On Aug 9, 2007, at 10:19 AM, Steve Lamb wrote: > > Actually, it isn't. At no time have I ever had any problems > > with Python > > code which would not also be an issue in other code as well. The only > > difference being you have to be

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread David Brodbeck
On Aug 9, 2007, at 10:19 AM, Steve Lamb wrote: Actually, it isn't. At no time have I ever had any problems with Python code which would not also be an issue in other code as well. The only difference being you have to be careful about indention in one case, braces in the other. Stil

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread David Brodbeck
On Aug 9, 2007, at 9:25 AM, Steve Lamb wrote: for FILE in *.wav; do lame -h -b 160 "$FILE" "$FILE.mp3"; done Correct me if I'm wrong but wouldn't I just end up with with a bunch of files named blahblah.wav.mp3? Follow it with "rename .wav.mp3 .mp3 *". :) -- To UNSUBSCRIBE, ema

Re: Python intention (Was: bash vs. python scripts - which one is better?)

2007-08-09 Thread Manon Metten
Hi Steve, Thanks for explaining. I'll examine some scripts I'll find on the web, to get an idea of how it looks. Manon.

Python intention (Was: bash vs. python scripts - which one is better?)

2007-08-09 Thread Steve Lamb
Manon Metten wrote: > Than, probably I didn't understand it correct. I thought of it as some > prefixed indentation. I like eg. to indent with two spaces and not four or > six. But then I consequently stick to it. If that's what you mean, then it > ain't no problem for me. It is but it isn't.

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Jeff D
On Thu, 9 Aug 2007, mmiller3 wrote: "Jeff" == Jeff D <[EMAIL PROTECTED]> writes: > You would still have rename the file extention: > for FILE in *wav ; do lame -h -b 160 "$FILE" "`echo $FILE > |sed s/.wav/.mp3/g ` " ; done Or just use the shell itself: for FILE in *wav ; do lame -

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread mmiller3
> "Jeff" == Jeff D <[EMAIL PROTECTED]> writes: > You would still have rename the file extention: > for FILE in *wav ; do lame -h -b 160 "$FILE" "`echo $FILE > |sed s/.wav/.mp3/g ` " ; done Or just use the shell itself: for FILE in *wav ; do lame -h -b 160 \"$FILE\" \"${FILE%.

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/09/07 12:19, Steve Lamb wrote: > Manon Metten wrote: >> Well, I find Perl easier to understand. The problem may be with some >> programmers who don't know how to write readable code... Now, the thing >> I really hate concerning python

Re: bash vs. python scripts - which one is better?

2007-08-09 Thread Manon Metten
Hi Steve, On 8/9/07, Steve Lamb <[EMAIL PROTECTED]> wrote: >> python ... is sensitive to indentation; > > > Well, that's a major disadvantage to me too. > > Actually, it isn't. At no time have I ever had any problems with > Python > code which would not also be an issue in other code as wel

  1   2   >