tech-userlevel archive

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

Re: humanize_number(3) for dd(1) summary?



On 04.12.2010 06:33, Matthew Mondor wrote:
>> conv=human looks convenient, but it looks a bit too generic to me. And
>> adding just a flag= or display= argument for that is IMHO overkill.
> 
> The only problem I see is that scripts won't need human output (and
> don't expect it), but that humans have to type a number of extra
> characters to obtain that behaviour, and they're the ones typing
> commands in manually.  At least -h would be short to add.
> 
> But would it make sense if dd detected interactive use (i.e. using
> isatty on stderr) and enabled the human display format by default then?

Indeed, I can add some intelligence to dd(1) via isatty(). I know that
some binaries (ls(1), man(1)) have their behaviour "automagically" adapt
to the type of output terminal.

However, I think it contradicts principle of least suprise here: when
someone (in the distant future) tries to write a script with dd(1),
given the relative complexity of the summary line, he's likely to try
its stuff with the output from command line first.

Only to find later that, unexpectedly, the output will change when piped
through its custom program. Using it with awk(1) is a good example.

-- 
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost


Home | Main Index | Thread Index | Old Index