Argument list too long: /bin/sh on Linux redhat

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I am having a script named as test.sh, which I use to run as below, which works fine:-



/root/test.sh


Then i tried to compile this script using the shc compiler as below with Warning:-



shc -v -r -T -f test.sh
shc: WARNING!!
Scripts of length near to (or higher than) the current System limit on
"maximum size of arguments to EXEC", could comprise its binary execution.
In the current System the call sysconf(_SC_ARG_MAX) returns -1 bytes
and your script "test.sh" is 155201 bytes length.
shc shll=sh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc test.sh.x.c -o test.sh.x
shc: strip test.sh.x
shc: chmod go-r test.sh.x


as a result of this warning i am not able to run this compiled file:-



./test.sh.x
./test.sh.x: Argument list too long: /bin/sh


can anyone help me out to fix this issue? How can i increase the limit of _SC_ARG_MAX so that i can compile the scripts.



thanks to help me on this.



Best Regards,
JAS










share|improve this question





















  • As you can see: 1) It's a warning, not an error, and 2) the value -1 for the current _SC_ARG_MAX is nonsensical. Also 3) You would have to change the limit in one of the system header files and recompile everything that uses that header.
    – Kusalananda
    Sep 25 '17 at 16:00











  • The -1 thing I alluded to above means no matter what you increase _SC_ARG_MAX to, it would likely still complain as it doesn't seem to read the value correctly.
    – Kusalananda
    Sep 25 '17 at 16:56










  • sysconf(3) returns -1 only in case of an error. _SC_ARG_MAX is required by POSIX, so you're looking at a bug either in shc or in your libc.
    – Satō Katsura
    Sep 25 '17 at 17:07














up vote
0
down vote

favorite












I am having a script named as test.sh, which I use to run as below, which works fine:-



/root/test.sh


Then i tried to compile this script using the shc compiler as below with Warning:-



shc -v -r -T -f test.sh
shc: WARNING!!
Scripts of length near to (or higher than) the current System limit on
"maximum size of arguments to EXEC", could comprise its binary execution.
In the current System the call sysconf(_SC_ARG_MAX) returns -1 bytes
and your script "test.sh" is 155201 bytes length.
shc shll=sh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc test.sh.x.c -o test.sh.x
shc: strip test.sh.x
shc: chmod go-r test.sh.x


as a result of this warning i am not able to run this compiled file:-



./test.sh.x
./test.sh.x: Argument list too long: /bin/sh


can anyone help me out to fix this issue? How can i increase the limit of _SC_ARG_MAX so that i can compile the scripts.



thanks to help me on this.



Best Regards,
JAS










share|improve this question





















  • As you can see: 1) It's a warning, not an error, and 2) the value -1 for the current _SC_ARG_MAX is nonsensical. Also 3) You would have to change the limit in one of the system header files and recompile everything that uses that header.
    – Kusalananda
    Sep 25 '17 at 16:00











  • The -1 thing I alluded to above means no matter what you increase _SC_ARG_MAX to, it would likely still complain as it doesn't seem to read the value correctly.
    – Kusalananda
    Sep 25 '17 at 16:56










  • sysconf(3) returns -1 only in case of an error. _SC_ARG_MAX is required by POSIX, so you're looking at a bug either in shc or in your libc.
    – Satō Katsura
    Sep 25 '17 at 17:07












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am having a script named as test.sh, which I use to run as below, which works fine:-



/root/test.sh


Then i tried to compile this script using the shc compiler as below with Warning:-



shc -v -r -T -f test.sh
shc: WARNING!!
Scripts of length near to (or higher than) the current System limit on
"maximum size of arguments to EXEC", could comprise its binary execution.
In the current System the call sysconf(_SC_ARG_MAX) returns -1 bytes
and your script "test.sh" is 155201 bytes length.
shc shll=sh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc test.sh.x.c -o test.sh.x
shc: strip test.sh.x
shc: chmod go-r test.sh.x


as a result of this warning i am not able to run this compiled file:-



./test.sh.x
./test.sh.x: Argument list too long: /bin/sh


can anyone help me out to fix this issue? How can i increase the limit of _SC_ARG_MAX so that i can compile the scripts.



thanks to help me on this.



Best Regards,
JAS










share|improve this question













I am having a script named as test.sh, which I use to run as below, which works fine:-



/root/test.sh


Then i tried to compile this script using the shc compiler as below with Warning:-



shc -v -r -T -f test.sh
shc: WARNING!!
Scripts of length near to (or higher than) the current System limit on
"maximum size of arguments to EXEC", could comprise its binary execution.
In the current System the call sysconf(_SC_ARG_MAX) returns -1 bytes
and your script "test.sh" is 155201 bytes length.
shc shll=sh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc test.sh.x.c -o test.sh.x
shc: strip test.sh.x
shc: chmod go-r test.sh.x


as a result of this warning i am not able to run this compiled file:-



./test.sh.x
./test.sh.x: Argument list too long: /bin/sh


can anyone help me out to fix this issue? How can i increase the limit of _SC_ARG_MAX so that i can compile the scripts.



thanks to help me on this.



Best Regards,
JAS







linux shell-script rhel compiler






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 25 '17 at 15:55









jassi10781

112




112











  • As you can see: 1) It's a warning, not an error, and 2) the value -1 for the current _SC_ARG_MAX is nonsensical. Also 3) You would have to change the limit in one of the system header files and recompile everything that uses that header.
    – Kusalananda
    Sep 25 '17 at 16:00











  • The -1 thing I alluded to above means no matter what you increase _SC_ARG_MAX to, it would likely still complain as it doesn't seem to read the value correctly.
    – Kusalananda
    Sep 25 '17 at 16:56










  • sysconf(3) returns -1 only in case of an error. _SC_ARG_MAX is required by POSIX, so you're looking at a bug either in shc or in your libc.
    – Satō Katsura
    Sep 25 '17 at 17:07
















  • As you can see: 1) It's a warning, not an error, and 2) the value -1 for the current _SC_ARG_MAX is nonsensical. Also 3) You would have to change the limit in one of the system header files and recompile everything that uses that header.
    – Kusalananda
    Sep 25 '17 at 16:00











  • The -1 thing I alluded to above means no matter what you increase _SC_ARG_MAX to, it would likely still complain as it doesn't seem to read the value correctly.
    – Kusalananda
    Sep 25 '17 at 16:56










  • sysconf(3) returns -1 only in case of an error. _SC_ARG_MAX is required by POSIX, so you're looking at a bug either in shc or in your libc.
    – Satō Katsura
    Sep 25 '17 at 17:07















As you can see: 1) It's a warning, not an error, and 2) the value -1 for the current _SC_ARG_MAX is nonsensical. Also 3) You would have to change the limit in one of the system header files and recompile everything that uses that header.
– Kusalananda
Sep 25 '17 at 16:00





As you can see: 1) It's a warning, not an error, and 2) the value -1 for the current _SC_ARG_MAX is nonsensical. Also 3) You would have to change the limit in one of the system header files and recompile everything that uses that header.
– Kusalananda
Sep 25 '17 at 16:00













The -1 thing I alluded to above means no matter what you increase _SC_ARG_MAX to, it would likely still complain as it doesn't seem to read the value correctly.
– Kusalananda
Sep 25 '17 at 16:56




The -1 thing I alluded to above means no matter what you increase _SC_ARG_MAX to, it would likely still complain as it doesn't seem to read the value correctly.
– Kusalananda
Sep 25 '17 at 16:56












sysconf(3) returns -1 only in case of an error. _SC_ARG_MAX is required by POSIX, so you're looking at a bug either in shc or in your libc.
– Satō Katsura
Sep 25 '17 at 17:07




sysconf(3) returns -1 only in case of an error. _SC_ARG_MAX is required by POSIX, so you're looking at a bug either in shc or in your libc.
– Satō Katsura
Sep 25 '17 at 17:07










1 Answer
1






active

oldest

votes

















up vote
0
down vote













The program that you are using is not reading _SC_ARG_MAX correctly and reports it as -1.



This means that even if you tried to increase this value (which would include fiddling in the system header files and recompiling at least the kernel and a few utilities), it would probably still not read the correct value.



The message is a warning, which means that it's not fatal. It is likely that whatever operation the utility preformed went ok.



The system configuration variable ARG_MAX (which has the value of the symbolic constant _SC_ARG_MAX) has the value 2097152 on Ubuntu and 262144 on OpenBSD (getconf ARG_MAX). Your value, 155201, is well within those.



I don't have access to a RedHat machine to see what this value may be there.






share|improve this answer
















  • 1




    RHEL 6.7: ARG_MAX = 2621440, RHEL 7.4: ARG_MAX = 2097152.
    – Christopher
    Sep 25 '17 at 17:14











  • I am on Red Hat Enterprise Linux Server release 6.6 Current Value in limit.h is as below:- #define ARG_MAX 131072 /* # bytes of args + environ for exec() */
    – jassi10781
    Sep 26 '17 at 4:30











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f394342%2fargument-list-too-long-bin-sh-on-linux-redhat%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













The program that you are using is not reading _SC_ARG_MAX correctly and reports it as -1.



This means that even if you tried to increase this value (which would include fiddling in the system header files and recompiling at least the kernel and a few utilities), it would probably still not read the correct value.



The message is a warning, which means that it's not fatal. It is likely that whatever operation the utility preformed went ok.



The system configuration variable ARG_MAX (which has the value of the symbolic constant _SC_ARG_MAX) has the value 2097152 on Ubuntu and 262144 on OpenBSD (getconf ARG_MAX). Your value, 155201, is well within those.



I don't have access to a RedHat machine to see what this value may be there.






share|improve this answer
















  • 1




    RHEL 6.7: ARG_MAX = 2621440, RHEL 7.4: ARG_MAX = 2097152.
    – Christopher
    Sep 25 '17 at 17:14











  • I am on Red Hat Enterprise Linux Server release 6.6 Current Value in limit.h is as below:- #define ARG_MAX 131072 /* # bytes of args + environ for exec() */
    – jassi10781
    Sep 26 '17 at 4:30















up vote
0
down vote













The program that you are using is not reading _SC_ARG_MAX correctly and reports it as -1.



This means that even if you tried to increase this value (which would include fiddling in the system header files and recompiling at least the kernel and a few utilities), it would probably still not read the correct value.



The message is a warning, which means that it's not fatal. It is likely that whatever operation the utility preformed went ok.



The system configuration variable ARG_MAX (which has the value of the symbolic constant _SC_ARG_MAX) has the value 2097152 on Ubuntu and 262144 on OpenBSD (getconf ARG_MAX). Your value, 155201, is well within those.



I don't have access to a RedHat machine to see what this value may be there.






share|improve this answer
















  • 1




    RHEL 6.7: ARG_MAX = 2621440, RHEL 7.4: ARG_MAX = 2097152.
    – Christopher
    Sep 25 '17 at 17:14











  • I am on Red Hat Enterprise Linux Server release 6.6 Current Value in limit.h is as below:- #define ARG_MAX 131072 /* # bytes of args + environ for exec() */
    – jassi10781
    Sep 26 '17 at 4:30













up vote
0
down vote










up vote
0
down vote









The program that you are using is not reading _SC_ARG_MAX correctly and reports it as -1.



This means that even if you tried to increase this value (which would include fiddling in the system header files and recompiling at least the kernel and a few utilities), it would probably still not read the correct value.



The message is a warning, which means that it's not fatal. It is likely that whatever operation the utility preformed went ok.



The system configuration variable ARG_MAX (which has the value of the symbolic constant _SC_ARG_MAX) has the value 2097152 on Ubuntu and 262144 on OpenBSD (getconf ARG_MAX). Your value, 155201, is well within those.



I don't have access to a RedHat machine to see what this value may be there.






share|improve this answer












The program that you are using is not reading _SC_ARG_MAX correctly and reports it as -1.



This means that even if you tried to increase this value (which would include fiddling in the system header files and recompiling at least the kernel and a few utilities), it would probably still not read the correct value.



The message is a warning, which means that it's not fatal. It is likely that whatever operation the utility preformed went ok.



The system configuration variable ARG_MAX (which has the value of the symbolic constant _SC_ARG_MAX) has the value 2097152 on Ubuntu and 262144 on OpenBSD (getconf ARG_MAX). Your value, 155201, is well within those.



I don't have access to a RedHat machine to see what this value may be there.







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 25 '17 at 17:02









Kusalananda

106k14209327




106k14209327







  • 1




    RHEL 6.7: ARG_MAX = 2621440, RHEL 7.4: ARG_MAX = 2097152.
    – Christopher
    Sep 25 '17 at 17:14











  • I am on Red Hat Enterprise Linux Server release 6.6 Current Value in limit.h is as below:- #define ARG_MAX 131072 /* # bytes of args + environ for exec() */
    – jassi10781
    Sep 26 '17 at 4:30













  • 1




    RHEL 6.7: ARG_MAX = 2621440, RHEL 7.4: ARG_MAX = 2097152.
    – Christopher
    Sep 25 '17 at 17:14











  • I am on Red Hat Enterprise Linux Server release 6.6 Current Value in limit.h is as below:- #define ARG_MAX 131072 /* # bytes of args + environ for exec() */
    – jassi10781
    Sep 26 '17 at 4:30








1




1




RHEL 6.7: ARG_MAX = 2621440, RHEL 7.4: ARG_MAX = 2097152.
– Christopher
Sep 25 '17 at 17:14





RHEL 6.7: ARG_MAX = 2621440, RHEL 7.4: ARG_MAX = 2097152.
– Christopher
Sep 25 '17 at 17:14













I am on Red Hat Enterprise Linux Server release 6.6 Current Value in limit.h is as below:- #define ARG_MAX 131072 /* # bytes of args + environ for exec() */
– jassi10781
Sep 26 '17 at 4:30





I am on Red Hat Enterprise Linux Server release 6.6 Current Value in limit.h is as below:- #define ARG_MAX 131072 /* # bytes of args + environ for exec() */
– jassi10781
Sep 26 '17 at 4:30


















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f394342%2fargument-list-too-long-bin-sh-on-linux-redhat%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay