limit of command length | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

limit of command length

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-18-2008
Anta Anta is offline
Registered User
 
Join Date: Dec 2004
Last Activity: 15 July 2013, 12:48 AM EDT
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
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
Sponsored Links
    #2  
Old 04-19-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
 
Join Date: Mar 2008
Last Activity: 28 March 2011, 6:41 AM EDT
Location: /there/is/only/bin/sh
Posts: 3,653
Thanks: 0
Thanked 10 Times in 8 Posts
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?
The Following User Says Thank You to era For This Useful Post:
DerekAsirvadem (01-07-2011)
Sponsored Links
    #3  
Old 10-11-2008
s.mascheck s.mascheck is offline
Registered User
 
Join Date: Jul 2008
Last Activity: 27 February 2011, 8:44 AM EST
Location: Southern Germany
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Quote:
Originally Posted by era View Post
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.)
The Following User Says Thank You to s.mascheck For This Useful Post:
DerekAsirvadem (01-07-2011)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk: Program length limit ? DerekAsirvadem Shell Programming and Scripting 9 01-11-2011 09:30 AM
Is there a limit for a code line length in C? alex_5161 Programming 8 06-23-2010 12:53 PM
AWK limit for (length) function? CKT_newbie88 Shell Programming and Scripting 3 05-03-2009 11:57 PM
Is the Length of User ID for AIX Limit to 8 Characters? meihua_t AIX 2 04-07-2008 03:04 AM
grep line length limit hnhegde Shell Programming and Scripting 3 10-02-2006 12:47 PM



All times are GMT -4. The time now is 04:58 PM.