Discussion:
avoid sending binary output to terminal
Daniel Stenberg
2017-05-25 22:33:43 UTC
Permalink
Hey,

One of the things in curl people have gotten annoyed about more than once
through-out the years, is the fact that curl sends everything to stdout by
default no matter what it is. Sending binary stuff to the terminal may lead to
unhappy faces.

I've started to work on code that checks for binary output to the terminal and
avoids it, unless told okay:

https://github.com/curl/curl/pull/1512

As always, comments and feedback are welcome!
--
/ daniel.haxx.se
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.
Xeno Campanoli via curl-users
2017-05-26 20:41:12 UTC
Permalink
reset

You could for instance use tr to filter out anything you want. That's
the whole point of it.

What you cannot do is deal with UTF-8, or anything else where you are
interpreting multiple length encoding. Well, for compression you
have zcat for gzip, and perhaps others, but it seems to me there is a
place in curl to either link to or cooperate with encoding libraries,
which is something you might not always have a good way to do in
shell. Even that though piping would be a more unixy flavor to do it
in.

xc
Typically in the past that would be handled by a pipe filter. People
still do that, don't they?
How would a "pipe filter" save someone who accidentally sends a jpeg to
stdout?
Also, I think a more interesting mechanism would be handling the swamps of
heterogeneous encodings, like the 9000 accidental ones from MSW systems.
Do you mean "more interesting" as in the current way of detecting accidental
binary output isn't good enough for this use case, or are you saying you
want to suggest a better way to detect binary ouput?
--
/ daniel.haxx.se
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Et

Loading...