The "loop and a half"

Chris Angelico rosuav at gmail.com
Fri Oct 6 15:31:58 EDT 2017


On Sat, Oct 7, 2017 at 6:18 AM, bartc <bc at freeuk.com> wrote:
>> I don't know if anybody has seen a market/need for an interactive sort
>> program, but there's nothing preventing you from writing one.
>
>
> For sort, there is no real need. You use a text editor to create your data.
> Then use existing file-based sort.

How about this: you run "du -sb *" to get directory sizes, and then
after the info's on screen, you want to show the five largest. You
could rerun the command, piped into "sort -n", or you could grab the
existing text from your console and sort it. Do you have to switch
across to a text editor, save the output there, and then sort it? Or
do you invoke "sort -n" with no other args, paste straight from
terminal back into the same terminal, hit Ctrl-D, and then read the
output?

I have done this exact thing multiple times.

ChrisA



More information about the Python-list mailing list