limit of command length


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers limit of command length
# 1  
Old 04-18-2008
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
# 2  
Old 04-19-2008
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?
This User Gave Thanks to era For This Post:
# 3  
Old 10-11-2008
Quote:
Originally Posted by era
I like the method with cpp to find the macros in the headers.

There you also write:

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

Quote:
IRIX 5.3 IP12: ARG_MAX / 5120
The run time limit (it can be changed with "systune") usually is higher, e.g. 20480.

Quote:
There are allegedly old systems with ARG_MAX set as low as 2048 or even 1024 bytes.
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.)
This User Gave Thanks to s.mascheck For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Limit string length with sed

Hi. I'm trying to learn sed. I want to limit the length of a string. I tried this: sed -n 's/^\(...........................\).*/\1/p' textfile.txt This works fine, but how do I give it as a range rather than putting a hundred dots? I'd like to limit the number of characters to 144 for... (3 Replies)
Discussion started by: troglodytes
3 Replies

2. Programming

Is there a limit for a code line length in C?

Is there any stabdard limitation on size of a code line in C code? I am interesting in UNIX limitation, particulary on SUN. Thanks! (8 Replies)
Discussion started by: alex_5161
8 Replies

3. Shell Programming and Scripting

Limit of ls command in for loop

I am using the code below to list all the Errors files from the directory in the for loop. When the number of files are less then 6000 then it's works fine but if it more than that then for loop fails. for file in `ls $ERR_DIR/PPL_Prov_Engine_Error_*` do memrecno=`cut -f2 -d'|' $file` ||... (6 Replies)
Discussion started by: mr_harish80
6 Replies

4. Shell Programming and Scripting

AWK limit for (length) function?

I am trying to use the following code: awk '{s=$0;if(length(s) < 750){getline; s=s " " $0}printf("%s\n",s)}' filename but an error shows that 'awk' is too long. Is there a limit to the awk length function? and what could be an alternate solution for long fixed width records? The code... (3 Replies)
Discussion started by: CKT_newbie88
3 Replies

5. Cybersecurity

~ IPTables : Limit Incoming UDP Packets With a Certain Length ~

Hello, I am currently trying to limit incoming UDP length 20 packets on a per IP basis to 5 a second using IPTables on a Linux machine (CentOS 5.2). Basically, if an IP is sending more than 5 length 20 UDP packet a second to the local machine, I would like the machine to drop the excess... (1 Reply)
Discussion started by: tomboy123
1 Replies

6. UNIX for Dummies Questions & Answers

What the command to find out the record length of a fixed length file?

I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies

7. AIX

Is the Length of User ID for AIX Limit to 8 Characters?

Hi, I'm using AIX version 5.3 currently. I'm trying to create a user id, e.g. andyleong, which the system prompted the length is too long. 1. I would like to know is that the length of user id is limited to maximum 8 characters for AIX. 2. Is it apply to all versions of AIX? If no... (2 Replies)
Discussion started by: meihua_t
2 Replies

8. Shell Programming and Scripting

Is there a limit to mget command?

Hi All, I am using a csh ftp to get all the relevant files i need. When i reduce the number of file to 4 (which is aaa,bbb,ccc,ddd), the script manage to get all the files i need. But when i add "eee" to the mget command, it doesn;t seem to get any files at all. Is there a limit to how many... (0 Replies)
Discussion started by: Raynon
0 Replies

9. Shell Programming and Scripting

grep line length limit

Hi Friends, I am having a funny problem with grep. When I run grep 'expr' file.txt things work fine. But when try to get the line number using the -n option, i.e, grep -n 'expr' file.txt I get a message, "grep: 0652-226 Maximum line length of 2048 exceeded." If the line has more than... (3 Replies)
Discussion started by: hnhegde
3 Replies

10. UNIX for Dummies Questions & Answers

Limit command

I have installed vnc on my computer but do not want every one to be able to incite a vncserver how can I limit users of the vncserver command to only a specifc group? (1 Reply)
Discussion started by: macdonto
1 Replies
Login or Register to Ask a Question