| |
| |
| |
|
Comments:
<pasteling> "ccs" at 70.127.159.246 pasted "csd" (1 line, 2B) at http://sial.org/pbot/17868 <howzee> hi all <howzee> is there any max limit on the command line arguments? <twkm> usually, yes. <howzee> whatz the upper limit? <twkm> depends on the system. <twkm> if your system has it: ''getconf ARG_MAX'' <howzee> getconf ARG_MAX <howzee> 1048320 <howzee> that means? <twkm> that means that you can have 1048320 bytes in the arguments, including the command name, actual path to the program, and a null byte between each argument, as well as room for the exported environment. <howzee> how can i modify the same/ <twkm> you cannot. <howzee> even if I've root privileges? <twkm> perhaps your system permits it. there is no way to get ksh to change it, ksh just obeys it. <howzee> i think bash doesn't obey this rule... right? <howzee> only ksh has the restriction <twkm> it is a system rule, there is nothing any shell can do to avoid it. <howzee> but i just found that bash can exceed this limit <twkm> *shrug* <twkm> i doubt it can. but you aren't saying much so it is hard to say. <howzee> ksh has another restriction that any single argument shouldn't exceed 2048 chars? <howzee> # perl -e 'print "A" x 102480' |xargs echo <howzee> xargs: A single arg was greater than the max arglist size of 2048 characters <twkm> that is an xargs issue, not ksh. <howzee> oops: thanx for the info <howzee> i just ran the following command from ksh, it worked fine <howzee> perl -e 'print "A " x 1048321' | xargs echo <howzee> how come? my system limit is 1048320 <twkm> because more than just those 2 million characters need room. <twkm> the exported environment, the program name, the full path to the program, a null byte between each argument and environment. <howzee> 1048320 means the total bytes shouldnt exceed this value, in this case, the argument has exceeded this value <twkm> right. <howzee> the command shouldn't work right? as it has overflowed the val <twkm> xargs breaks apart the input into chunks that are allowed. <twkm> no, "A " 2 million times can be broken into multiple commands -- that is what xargs does. <twkm> err, "A " 1 million times. <howzee> echo `perl -e 'print "A" x 1048400'` <howzee> this also works fine .. it shouldn't right <howzee> echo `perl -e 'print "A" x 1048400'` | wc -c <howzee> 1048401 <twkm> since echo is a builtin command it can exceed the limits, because exec is not involved. <twkm> $ echo "$(perl -e 'print "a"x1310720')" | wc -c 1310721 <twkm> hmm, silly paste thingy. the 1310721 was the result of the wc -c. <twkm> $ /usr/bin/echo "$(perl -e 'print "a"x1310720')" | wc -c <twkm> ksh: /usr/bin/echo: cannot execute [Argument list too long] 0 <howzee> twkm: cool ... thanx a lot !!! <twkm> sure thing. <howzee> twkm: i appreciate that ... ur explanation was too good <twkm> cool. <howzee> whatz the env variable conntrolling history size in ksh? <howzee> in bash its HISTSIZE i suppose <Rado> howzee, have you tried "man ksh"? <howzee> man page suggests the same variable, HISTSIZE <howzee> but it is not working <howzee> i tried setting the value to 0 <payal> hi <payal> please check this very simple script <payal> http://pastebin.ca/67741 <payal> even though I have given num -ne -1 instead of $num, it still works - Why? <payal> anyone ????? <payal> any ideas?
Return to
#ksh or Go to some related
logs:
glibc-intermediate FPA error php script * grabs urls besific compiling sharpconstruct ubuntu IE XMLHTTPRequest Invalid Syntax
gtkterm package in XUBUNTU error: System has no support for gtk python interface #gentoo wmv vlc fedora win32codecs vnc grey screen damn small linux
|
|