NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/57253: xargs wraps lines after ~4k characters
>Number: 57253
>Category: bin
>Synopsis: xargs wraps lines after ~4k characters
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Thu Mar 02 09:05:00 +0000 2023
>Originator: Marc Fege
>Release: 9.3
>Organization:
>Environment:
NetBSD rpi.marc.fege.local 9.3 NetBSD 9.3 (RPI) #0: Thu Aug 4 15:30:37 UTC 2022 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/evbarm/compile/RPI evbarm
>Description:
Hello everyone,
I have some very long output lines in various shell scripts needed to be processed by xargs.
After a certain length of input the 'xargs' command wraps lines automatically after ARG_MAX, as it is described by the man page in paragraph "-s". This to remove the newlines characters one need to remove them with a 'tr -d "\n"' just in case xargs ever produce ones. However, a common user as me might not expect this behaviour/limitation occuring in the 21st century any more and uses xargs to line up all input data to a giant one line argument to be processed. As long as there is addressable memory available, no command should forcefully ever wrap after a certain amount of line length or stop working on an artificially limit set, even if this limit had a reason in former times. I am not a software develloper at all. So I just could give a more ore less educated guess.
Good success on your projects
Marc Fege.
>How-To-Repeat:
Gather a very long line beyond ARG_MAX and pipe it through 'xargs'. Output will have additional \n in it.
>Fix:
Replace ARG_MAX limitations with malloc().
Home |
Main Index |
Thread Index |
Old Index