help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] why bash shows the same error for both too many argument


From: Greg Wooledge
Subject: Re: [Help-bash] why bash shows the same error for both too many arguments or an argument that is too long?
Date: Fri, 28 Oct 2016 16:29:49 -0400
User-agent: Mutt/1.4.2.3i

On Fri, Oct 28, 2016 at 03:22:45PM -0500, Peng Yu wrote:
> ~$ "$(type -P echo)" "$(seq 100000)"
> -bash: /usr/local/opt/coreutils/libexec/gnubin/echo: Argument list too long
> ~$ "$(type -P echo)" $(seq 100000)
> -bash: /usr/local/opt/coreutils/libexec/gnubin/echo: Argument list too long

First of all, this error is coming from the kernel, not from the shell.
Even though it says -bash at the beginning, the limitation is one in
your operating system, not in bash.

http://www.in-ulm.de/~mascheck/various/argmax/ is an excellent reference
for this subject.

> The following two commands show the same error message. But for the
> first command, there is only one argument. Is there error message
> incorrect? Also, why bash fails for the first case. Is there any
> restriction on the length of a single argument?

The restriction is on the total length (in bytes) of the argument list,
not the number of arguments.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]