On 03/13/2014 10:35 AM, Paul Eggert wrote: > On 03/13/2014 01:21 AM, Pavel Raiskup wrote: >>> We could detect that archive contents are coming from terminal input and >>> fail immediately (IIRC tar waits indefinitely ATM until it's input is >>> cut >>> by ctrl+d or it is killed). >> I meant something like the patch attached, could you please consider? >> >> I tried to write testcase for this and I failed to find proper 'script' >> alternative tool among coreutils, is there some? I could rewrite it >> then. >> >> Pavel > This sort of thing would seem to run counter to the GNU coding > standards, which say that the behavior a program should not depend on > the type of device it is used with. > > http://www.gnu.org/prep/standards/html_node/User-Interfaces.html
However, findutils has done just that, so it wouldn't be the first time that GNU software has been chattier when a terminal is involved: $ : | xargs --show-limits Your environment variables take up 3522 bytes POSIX upper limit on argument length (this system): 2091582 POSIX smallest allowable upper limit on argument length (all systems): 4096 Maximum length of command we could actually use: 2088060 Size of command buffer we are actually using: 131072 $ xargs --show-limits Your environment variables take up 3522 bytes POSIX upper limit on argument length (this system): 2091582 POSIX smallest allowable upper limit on argument length (all systems): 4096 Maximum length of command we could actually use: 2088060 Size of command buffer we are actually using: 131072 Execution of xargs will continue now, and it will try to read its input and run commands; if this is not what you wanted to happen, please type the end-of-file keystroke. Warning: echo will be run at least once. If you do not want that to happen, then press the interrupt keystroke. [Ctrl-D] -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature