[lug] Limits of grep?

Michael J. Pedersen marvin at keepthetouch.org
Tue Sep 26 09:25:29 MDT 2000


On Tue, Sep 26, 2000 at 07:49:55AM -0600, Hugh Brown wrote:
> This is a limitation of the shell most likely (on the order of 256
> characters, I think).

Some notes on these limitations of command lines (I know because I've recently
had cause to look):

command.com, under dos, had a command line limit of 127 characters.
command.com, under windows 95, had a larger limit, I think, of 256 characters
             (haven't had to look at that one, so not sure)
cmd.exe, under windows nt, has a hard limit of 2046 characters on the command
             line. The missing two characters to make it 2k are a newline and
			 null ('\0').
bash, I can't seem to find the limit, no matter how hard I try. It just keeps
             working. Someone else mentioned a limit of 4000 words, which
			 seems plausible enough.

All the Windows 95+ versions have a kernel call which will allow you create a
process with as large a command line as you wish (one person has reported
making a command line of 10 megabytes work correctly. Naturally, he was doing
this to see how far he could push this kernel call). Win3.1, I don't know if
it has a way of exceeding that command line limit, but I doubt it, since it's
(even more so than 95) just a shell on top of DOS.

-- 
Michael J. Pedersen
My GnuPG KeyID: 4E724A60        My Public Key Available At: wwwkeys.pgp.net
My GnuPG Key Fingerprint: C31C 7E90 5992 9E5E 9A02 233D D8DD 985E 4E72 4A60
GnuPG available at http://www.gnupg.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20000926/9f838611/attachment.pgp>


More information about the LUG mailing list