Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78096 > unrolled thread

Re: program to generate data helpful in finding duplicate large files

Started byChris Angelico <rosuav@gmail.com>
First post2014-09-20 14:53 +1000
Last post2014-09-20 14:53 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: program to generate data helpful in finding duplicate large files Chris Angelico <rosuav@gmail.com> - 2014-09-20 14:53 +1000

#78096 — Re: program to generate data helpful in finding duplicate large files

FromChris Angelico <rosuav@gmail.com>
Date2014-09-20 14:53 +1000
SubjectRe: program to generate data helpful in finding duplicate large files
Message-ID<mailman.14160.1411189137.18130.python-list@python.org>
On Sat, Sep 20, 2014 at 10:27 AM, Cameron Simpson <cs@zip.com.au> wrote:
> IMO, it is good that the shell is like that. It isn't Python.
>
> A great many small shell scripts are one liner wrappers, and this serves
> them well. A great many more are a lot of prep work followed by a major (and
> final) command. These are also served well.
>
> There is the hazard where someone careless goes:
>
>   ... main script ...
>   echo "script failed!" >&2
>
> and accidentally exits with 0 (success).
>
> For further fun, I run my shell scripts with the -e and -u options turned
> on.
>
> And of course for complicated stuff I usually maintain a $xit variable,
> setting it to 1 when something goes blam, and finishing such scripts with:
>
>   exit $xit
>
> But for wrappers, the shell default exit design is handy.

What you're saying here is that there are times when it's convenient,
and other times when it's inconvenient. And sure! That's definitely
true. What I contest, though, is that having it this way is the better
design. Even if the bulk of shell scripts are wrappers for single
commands and want to exit with their return values (which I suspect is
not the case), I believe the better design would be to have them put a
simple tag onto it like "|| exit $?". Of course, there's no changing
it now.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web