limit of command length

Hi!

Can you please help me with one question?

Does rexec command have some limitation of the length of the deliveded cmd?

Thanks in advance,
Anta

Probably it does, but there are many implementations, so if it is undocumented, you will have to experiment, or look at the source.

rexec is insecure and should be replaced by ssh if at all possible anyway.

Any command handled by the exec() system call needs to be less than ARG_MAX, which is a constant defined in the kernel. POSIX requires ARG_MAX to be 4,096 bytes, but on modern systems, it's usually significantly larger.

Shameless self-promotion: How long can the command line be?

I like the method with cpp to find the macros in the headers.

There you also write:

Instead of ARG_MAX it's still NCARGS there, like in early unix variants.
However, SunOS 4 knows "sysconf(_SC_ARG_MAX)".

The run time limit (it can be changed with "systune") usually is higher, e.g. 20480.

I don't believe there are systems after V7 with lower limits than 5120. V7 was released 1976 and is the first unix, which feels like systems we know today. (Predecessors like V4 or V6 still had 512 as limit.)