[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Finding command size; was Re: FIX for Arg list too long...
From: |
Robert Boehne |
Subject: |
Re: Finding command size; was Re: FIX for Arg list too long... |
Date: |
Thu, 07 Dec 2000 13:56:57 -0600 |
Howard Chu wrote:
>
> Robert Boehne wrote:
>
> > To all Gurus:
>
> > Ok, I'm currently working on the implementation of a fix
> > for "Arg list too long" errors, but I wonder if anyone
> > could give me advice on how to get the size of the
> > command that will be used. How about this:
>
> > length=`echo ${some_command} | dd bs=1 of=/dev/null 2>&1 | head -1 | cut
> > -d'+' -f1`
>
>
> Try
> length=`expr ${some_command} : ".*"`
>
> Of course, when some_command gets too long, it all falls apart. There's no
> way around that.
I also found this method in a bourne shell book, but how does it work?
I've been having a difficult time turning "$archive_cmds" into the
length
of the expanded command as it would get executed. So far, I have
new_cmd=`eval echo $archive_cmds`
which gives me the expanded command, but I can't seem to get
the length of this command.
If I use length=`expr ${some_command} : ".*"` then what will the
error be when the command is too long? Any other ideas?
--
Robert Boehne Software Engineer
Ricardo Software Chicago Technical Center
TEL: (630)789-0003 x. 238
FAX: (630)789-0127
email: address@hidden