[Top][All Lists]

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

Re: .ONESHELL enhancement?

From: Ralf Wildenhues
Subject: Re: .ONESHELL enhancement?
Date: Mon, 5 Oct 2009 06:26:55 +0200
User-agent: Mutt/1.5.20 (2009-08-09)

* Matt McCutchen wrote on Mon, Oct 05, 2009 at 05:15:25AM CEST:
> On Sun, 2009-10-04 at 10:55 +0200, Ralf Wildenhues wrote:
> > * Matt McCutchen wrote on Sun, Oct 04, 2009 at 09:51:25AM CEST:
> > > On Sat, 2009-10-03 at 10:12 +0000, Ralf Wildenhues wrote:
> > > > As another minor point, constructs used to avoid shell command line 
> > > > length
> > > > limitations may break with this optimization.
> > > 
> > > Is it still a problem to pass the shell a long multiline argument with
> > > -c?
> > 
> > Yes, but I'm not sure what you mean here.
> Maybe what I should have asked is, exactly what "shell command line
> length limitations" were you referring to?
> I am aware that Linux limits the argument length.  I tested on my
> computer and the limit appears to be 131071 characters.  IMO, any
> command script even close to that length ought to be factored out into a
> separate file, so I don't see that limit being a problem.

Well, then we just have to agree to disagree on this.  I believe that
one goal of GNU programs is to avoid arbitrary limitations.  We have had
a bug report against Automake or Libtool (can't remember) where this
limit was actually hit on GNU/Linux.  Of course, there are other systems
with way lower limit, such as IRIX with its 20K, or some w32 systesm with
an even lower one, where this matters more.

> > > If so, make could use a pipe or a temporary file.
> > 
> > Not sure what you're after here.
> If there's any kind of length limitation with -c (whether from the shell
> or the OS), possible alternatives would include running $(SHELL) and
> piping the script to its stdin, or writing the script to a temporary
> file and running "$(SHELL) TMPFILE".

How come GNU make doesn't do this (on all systems) then?  The answer is
probably that it won't help in most cases, as the script will likely
contain one command that itself trips the length limit.  This is one way
in which the newer Linux kernels differ from the rest of the unix world
though: only the length of a single argument is limited any more, not
the length of the whole command line.  I proposed a patch to work around
that argument limit a couple of months ago, and it was rejected
(rightfully, I should add, as the patch was hack).


reply via email to

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