Re: fedora 11 bash maximum line length?

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

 



On 20Jul2009 01:50, Frank Cox <theatre@xxxxxxxxxxx> wrote:
| What is the maximum length of a command line in bash on Fedora 11?
| 
| [frankcox@mutt ~]$ getconf ARG_MAX
| 2621440
| 
| Does this mean that I can enter over 2 million characters on a single bash
| command line?

Probably not - you can probably do more. (Actual answer at the bottom of
this message.)

Bash it self doesn't have a command line limit AFAIK; the shells
will all allow you to enter lines as long as you like subject to
available memory.

It was the case that ARG_MAX limited the total size of program arguments
plus environment strings, but recent linux kernals have made that
dynamic; not unlimited, sadly, but much much larger than it was; I
forget the criteria.

The result of this is that on a Linux system it is now much less likely
that users will hit the command line limit. However, there still is one,
so while users get more and more careless the number of scripts that can
break slowly grows.

On the other hand, it may contribute to making xargs a much less used
command, and that is generally good, since I routinely see it misused in
scripts by people who don't understand what it does and why it exists.
Seriously, I've seen it shoved into the middle of pipelines "just
because":-(

Anyway, "man 2 execve" ought to answer this question. And indeed,
I see it has a secion entitled "Limits on size of arguments and
environment" which talks about ARG_MAX and how that doesn't apply from
kernels 2.6.23 onwards.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

They call me a bummer and a gin-sop,too....but what care I for praise!
        - Bob Dylan.   "The days of '49"

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux