[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



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 lot easier with bash.

on the other hand if there's number/string parsing involved i can do a
lot better with python YMMV.

/martin


On 8/14/07, Vincent Lefevre <vincent@vinc17.org> wrote:
> 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 I knew it was a hack because setting $IFS just seems
> > > bad... possible unintended consquences, but it worked.
> > >
> >
> > I have seen something like the following:
> >
> > find | while read FILE;
> >       do echo "$FILE"
> > done
>
> which is almost as bad, as filenames can have \n characters in them.
> That's why "find" has -print0... Unfortunately the "read" builtin
> doesn't seem to support this feature (or anyone knows how to use
> its -d option to declare \0 as the delimiter?).
>
> --
> Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
> 100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
> Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>


-- 
Martin Marcher
martin.marcher@gmail.com
http://www.mycorners.com
https://www.xing.com/profile/Martin_Marcher
http://www.linkedin.com/in/martinmarcher
http://www.studivz.net/profile.php?ids=9f83ea8c5996b8ec
http://www.amazon.de/gp/registry/wishlist/3KDAGCL2NKOIM/ref=reg_hu-wl_goto-registry/302-4432803-5146435?ie=UTF8&sort=date-added

Reply to: