The "loop and a half"

Peter J. Holzer hjp-usenet3 at hjp.at
Fri Oct 6 09:11:26 EDT 2017


On 2017-10-06 12:38, bartc <bc at freeuk.com> wrote:
> On 06/10/2017 12:51, Chris Angelico wrote:
> > What you REALLY mean is that you can't see the point of an interactive
> > sort command. It doesn't fit into your workflow. And that's fine. It's
> > not something you'd use very often. There are other programs, however,
> > that behave exactly the same whether used in batch mode or interactive
> > mode, and where you would do exactly the same thing as I described -
> > provide input, and hit Ctrl-D to mark that you're done.
>
> Examples?
>
> And is there any reason why you wouldn't use a text editor to capture 
> your input first? I can see myself noticing an error I'd made 10 lines 
> up, which is now too late to change, and I've still got 100 lines to go. 
> What to do?
>
> I just can't anyone wanting to use programs that work in the way you 
> suggest. Not outside of a student exercise (read N numbers and display 
> the average), where getting the input correct isn't so important.

I regularly use at least cat, wc and od this way (plus a few of my own
utilities like utf8dump). I'm sure I've used sort this way, too, though
rather rarely. I usually don't type the input but paste it in, but the
program can't distinguish that: All it sees is some input from the
terminal at stdin.

        hp


-- 
   _  | Peter J. Holzer    | Fluch der elektronischen Textverarbeitung:
|_|_) |                    | Man feilt solange an seinen Text um, bis
| |   | hjp at hjp.at         | die Satzbestandteile des Satzes nicht mehr
__/   | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel



More information about the Python-list mailing list