neurobin / shc

Shell script compiler

Home Page:https://neurobin.org/projects/softwares/unix/shc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Argument list too long (maybe caused by a bunch of commented lines)

MdeLv opened this issue · comments

commented

debian11
bash 5.1.4(1)
The program (in bash) is 3500 lines.

Error message: Argument list too long: /bin/bash

Cause detected: approx 100 bash commented lines (#)
Once deleted, shc works again.

Is any limitation reached? (just 3500 lines)
Or is there another cause?

I suppose that shc drop all comments when building the executable, so there may be another cause.
What is weird is that shc has been working for weeks before that with these commented lines.
I tried to delete added functions but that's only deleting these 100 commented lines that fixed the trouble.

Thanks.

commented

Once again, I got the error message: "Argument list too long: /bin/bash", also solved with deleting commented lines.
However, this was not added commented lines. I just added normal loc.

What triggers the error message is still unknown.

Any idea for finding the root cause?

commented

Well...
In order to not getting this "Argument list too long: /bin/bash" error, you need not too many commented lines in your bash script.
The exact number and place of these comments that trigger this error are unknown...

Can the author give hints about how to avoid this error?
Thanks.

@MdeLv Hi, did you ever find a fix for this? I am having the same problem. Tried deleting all comments but no dice.

I don't know what can cause "Argument list too long".
Deleting enough comments (but not all) was enough in my case.

Maybe you have also some syntax error? Have you tried to use some lint tool to check that?
Or you can "compile" parts/modules of your program for detecting which part may trigger that error?

This is because sh c cannot exceed the ARG-MAX value. You need to try shellc to solve the problem of script file size